/* ===== СТИЛИ ДЛЯ СТРАНИЦЫ ШАБЛОНОВ ===== */

.templates-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Заголовок страницы */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    flex-wrap: wrap;
    gap: 20px;
    animation: fadeInUp 0.6s ease;
}

.page-title {
    font-size: 48px;
    background: linear-gradient(135deg, #fff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
    position: relative;
}

.page-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 80px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 4px;
}

/* Сетка шаблонов */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.template-card {
    background: rgba(28, 28, 30, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 32px;
    padding: 30px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.template-card:hover {
    transform: translateY(-10px);
    border-color: var(--accent);
    box-shadow: 0 30px 50px rgba(0,113,227,0.2);
}

.template-card.active {
    border: 2px solid var(--accent);
    box-shadow: 0 0 30px rgba(0,113,227,0.3);
}

.template-card.active::before {
    content: '✓';
    position: absolute;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
    z-index: 10;
}

.template-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.template-name {
    font-size: 24px;
    font-weight: 700;
    color: white;
    margin-bottom: 10px;
}

.template-description {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.template-preview {
    width: 100%;
    height: 200px;
    background: rgba(0,0,0,0.3);
    border-radius: 16px;
    margin-top: 20px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--text-muted);
    border: 1px solid rgba(255,255,255,0.05);
}

/* Секция кастомизации */
.customization-section {
    background: rgba(28, 28, 30, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease;
}

.section-title {
    font-size: 28px;
    margin-bottom: 30px;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--accent);
    font-style: normal;
    font-size: 32px;
}

/* Цветовая палитра */
.color-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.color-item {
    width: 100%;
    aspect-ratio: 1;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 3px solid transparent;
    position: relative;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.color-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 20px currentColor;
}

.color-item.selected {
    border-color: white;
    box-shadow: 0 0 20px currentColor;
}

.color-item.selected::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 20px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* Настройки цветов */
.color-settings {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.color-setting {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px;
}

.color-setting label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.color-input-group input[type="color"] {
    width: 50px;
    height: 50px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    background: transparent;
    padding: 0;
}

.color-input-group input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-input-group input[type="color"]::-webkit-color-swatch {
    border: 2px solid rgba(255,255,255,0.1);
    border-radius: 12px;
}

.color-input-group input[type="text"] {
    flex: 1;
    padding: 12px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: white;
    font-size: 14px;
    font-family: monospace;
    transition: all 0.3s ease;
}

.color-input-group input[type="text"]:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0,113,227,0.1);
}

/* Настройки шрифтов */
.fonts-section {
    margin-top: 20px;
}

.font-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.font-select {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px;
}

.font-select label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 10px;
    font-weight: 500;
}

.font-select select {
    width: 100%;
    padding: 14px 20px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.font-select select:focus {
    outline: none;
    border-color: var(--accent);
}

.font-preview {
    margin-top: 15px;
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    font-size: 16px;
    color: white;
    line-height: 1.5;
    border: 1px solid rgba(255,255,255,0.05);
}

/* Настройки layout */
.layout-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.layout-option {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.layout-option:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: rgba(0,113,227,0.05);
}

.layout-option.active {
    background: rgba(0,113,227,0.15);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0,113,227,0.2);
}

.layout-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.layout-name {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Настройки анимаций */
.animation-selector {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.animation-option {
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.animation-option:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
    background: rgba(0,113,227,0.05);
}

.animation-option.active {
    background: rgba(0,113,227,0.15);
    border-color: var(--accent);
    box-shadow: 0 0 20px rgba(0,113,227,0.2);
}

.animation-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.animation-name {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Предпросмотр */
.preview-section {
    background: rgba(28, 28, 30, 0.5);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.05);
    border-radius: 32px;
    padding: 40px;
    margin-bottom: 40px;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 20px;
}

.preview-header h2 {
    font-size: 24px;
    color: white;
    margin: 0;
}

.preview-card {
    background: var(--card-cardbg);
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: all 0.3s ease;
    max-width: 500px;
    margin: 0 auto;
}

.preview-image {
    width: 100%;
    height: 200px;
    background: linear-gradient(135deg, var(--card-primary), var(--card-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 64px;
    color: white;
}

.preview-content {
    padding: 25px;
}

.preview-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--card-primary);
}

.preview-price {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--card-secondary);
}

.preview-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.preview-features li {
    margin: 10px 0;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-features li::before {
    content: '✓';
    color: var(--card-accent);
    font-weight: 700;
    font-size: 16px;
}

/* Кнопки действий */
.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    flex-wrap: wrap;
}

.action-btn {
    min-width: 200px;
    padding: 16px 30px;
    border-radius: 40px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.action-btn.primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 10px 30px rgba(0,113,227,0.3);
}

.action-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0,113,227,0.5);
}

.action-btn.secondary {
    background: rgba(255,255,255,0.05);
    color: white;
    border: 1px solid rgba(255,255,255,0.1);
}

.action-btn.secondary:hover {
    background: rgba(255,255,255,0.1);
    transform: translateY(-3px);
}

/* Адаптивность */
@media (max-width: 768px) {
    .page-title {
        font-size: 36px;
    }
    
    .templates-grid {
        grid-template-columns: 1fr;
    }
    
    .color-settings {
        grid-template-columns: 1fr;
    }
    
    .font-selector {
        grid-template-columns: 1fr;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .preview-card {
        max-width: 100%;
    }
}