/* Стили для страницы общих шаблонов растений */

/* Заголовки и типографика */
.template-intro {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #0d6efd;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 8px;
}

.template-intro h2 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
}

.template-intro h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 1rem;
    color: #495057;
}

.template-intro p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.template-intro ul {
    margin-left: 1.5rem;
    margin-bottom: 0;
}

.template-intro ul li {
    margin-bottom: 0.5rem;
}

/* Фильтры */
.filters-section {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.filters-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.filters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.filter-item {
    display: flex;
    flex-direction: column;
}

.filter-item label {
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: #495057;
    font-size: 0.875rem;
}

/* Карточки шаблонов */
.template-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
}

.template-card:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.template-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.template-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.template-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.template-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #dee2e6;
}

.template-meta-item {
    display: flex;
    flex-direction: column;
}

.template-meta-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.template-meta-value {
    font-size: 0.875rem;
    color: #212529;
}

/* Таблица профилей */
.template-table-wrapper {
    overflow-x: auto;
    margin-top: 1rem;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.template-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 0.875rem;
}

.template-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.template-table th {
    font-weight: 600;
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 1px solid #dee2e6;
    white-space: nowrap;
}

.template-table td {
    text-align: center;
    padding: 0.75rem 0.5rem;
    border: 1px solid #dee2e6;
}

.template-table td:first-child {
    text-align: left;
    font-weight: 500;
}

.template-table input.small {
    padding: 0.25rem;
    text-align: center;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 0.875rem;
}

.template-table input.small:focus {
    outline: none;
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Группы колонок */
.template-table th.group-header {
    background: #e9ecef;
    font-weight: 700;
}

/* Модерация */
.moderation-badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 4px;
    background: #ffc107;
    color: #000;
}

/* Telegram ссылки */
.telegram-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.telegram-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    background: #0088cc;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: background 0.2s ease;
}

.telegram-links a:hover {
    background: #006699;
    color: #fff;
}

.telegram-links a::before {
    content: "✈️";
    font-size: 1rem;
}

/* Индикатор результатов фильтрации */
#filter-results-indicator {
    margin-top: 1rem;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Плавные переходы для карточек */
.template-card {
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.template-card:hover {
    transform: translateY(-2px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .template-intro {
        padding: 1rem;
    }

    .template-intro h2 {
        font-size: 1.5rem;
    }

    .template-intro h3 {
        font-size: 1.125rem;
    }

    .filters-section {
        padding: 1rem;
    }

    .filters-grid {
        grid-template-columns: 1fr;
    }

    .template-card {
        padding: 1rem;
    }

    .template-title {
        font-size: 1.25rem;
    }

    .template-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .template-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .template-meta {
        gap: 0.75rem;
    }

    .template-table {
        font-size: 0.75rem;
    }

    .template-table th,
    .template-table td {
        padding: 0.5rem 0.25rem;
    }

    .telegram-links {
        flex-direction: column;
    }

    .telegram-links a {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    h1 {
        font-size: 1.75rem;
    }

    .template-intro h2 {
        font-size: 1.25rem;
    }

    .template-intro h3 {
        font-size: 1rem;
    }

    .template-table {
        font-size: 0.65rem;
    }

    .template-table th,
    .template-table td {
        padding: 0.375rem 0.125rem;
    }
}

/* Печать */
@media print {
    .template-intro,
    .filters-section,
    .template-actions,
    .btn,
    .alert {
        display: none !important;
    }

    .template-card {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
        border: 1px solid #000;
    }
}

/* Кнопки */
.btn-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Полезные ссылки */
.useful-links-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    padding: 1.5rem;
    border: 1px solid #dee2e6;
}

.links-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.useful-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
}

.link-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    text-decoration: none;
    color: #212529;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.link-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: #0d6efd;
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: #0d6efd;
    text-decoration: none;
    color: #0d6efd;
}

.link-card:hover::before {
    transform: scaleY(1);
}

.link-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%);
    border-radius: 8px;
    color: #fff;
    font-size: 1.25rem;
    transition: all 0.3s ease;
}

.link-card:hover .link-card-icon {
    transform: rotate(5deg) scale(1.1);
}

.link-card-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
}

.link-card-title {
    font-weight: 500;
    font-size: 0.9375rem;
    line-height: 1.4;
}

.link-card-arrow {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.link-card:hover .link-card-arrow {
    transform: translateX(4px);
    color: #0d6efd;
}

/* Альтернативные цвета иконок для разнообразия */
.link-card:nth-child(2n) .link-card-icon {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
}

.link-card:nth-child(3n) .link-card-icon {
    background: linear-gradient(135deg, #dc3545 0%, #b02a37 100%);
}

.link-card:nth-child(4n) .link-card-icon {
    background: linear-gradient(135deg, #ffc107 0%, #cc9a06 100%);
}

.link-card:nth-child(5n) .link-card-icon {
    background: linear-gradient(135deg, #6f42c1 0%, #59359a 100%);
}

/* Адаптивность для ссылок */
@media (max-width: 768px) {
    .useful-links-grid {
        grid-template-columns: 1fr;
    }

    .link-card {
        padding: 0.875rem;
    }

    .link-card-icon {
        width: 36px;
        height: 36px;
        font-size: 1.125rem;
    }

    .link-card-title {
        font-size: 0.875rem;
    }
}
