/* ===================================
   Pick-Me AI - Pricing Page Styles
   =================================== */

/* ========== Pricing Toggle (Modern Style) ========== */
.pricing-header {
    text-align: center;
    margin-bottom: 3rem;
}

.pricing-toggle {
    position: relative;
    display: inline-flex;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    gap: 0;
}

/* Sliding background indicator - Glass Style */
.pricing-toggle::before {
    content: '';
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc(50% - 6px);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 12px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    z-index: 0;
    animation: slideGlow 3s ease-in-out infinite;
}

/* Пульсирующее свечение ползунка */
@keyframes slideGlow {
    0%, 100% {
        box-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.1),
            inset 0 1px 1px rgba(255, 255, 255, 0.2),
            inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow: 
            0 4px 20px rgba(255, 255, 255, 0.15),
            inset 0 1px 2px rgba(255, 255, 255, 0.3),
            inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    }
}

/* Усиленная анимация при переключении */
.pricing-toggle.studio-active::before {
    animation: slideGlowActive 0.6s ease-out;
}

@keyframes slideGlowActive {
    0% {
        box-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.1),
            inset 0 1px 1px rgba(255, 255, 255, 0.2),
            inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    }
    50% {
        box-shadow: 
            0 8px 32px rgba(255, 255, 255, 0.25),
            inset 0 2px 4px rgba(255, 255, 255, 0.4),
            inset 0 -1px 1px rgba(0, 0, 0, 0.05);
        transform: scale(1.02);
    }
    100% {
        box-shadow: 
            0 2px 12px rgba(0, 0, 0, 0.1),
            inset 0 1px 1px rgba(255, 255, 255, 0.2),
            inset 0 -1px 1px rgba(0, 0, 0, 0.05);
        transform: scale(1);
    }
}

/* Move indicator when studio is active */
.pricing-toggle.studio-active::before {
    left: 50%;
    animation: slideGlowActive 0.6s ease-out;
}

.toggle-btn {
    position: relative;
    padding: 0.9rem 1.5rem;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 1.05rem;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    width: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:hover {
    color: var(--text-light);
}

.toggle-btn.active {
    color: #ffffff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.btn-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-icon {
    font-size: 1rem;
    opacity: 0.7;
    transition: opacity 0.3s;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn.active .btn-icon {
    opacity: 1;
}

/* ========== Studio Model Count Selector ========== */
.model-count-selector {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.model-count-btn {
    padding: 0.75rem 1.5rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    color: var(--text-muted);
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.model-count-btn.active {
    border-color: var(--primary-purple);
    background: rgba(102, 126, 234, 0.1);
    color: var(--text-light);
}

.model-count-btn:hover {
    border-color: var(--primary-purple);
}

/* ========== Pricing Cards ========== */
.pricing-container {
    position: relative;
}

.pricing-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%; /* Занимаем всю доступную ширину */
}

/* Individual plans: 4 cards in one row */
#individual-plans .pricing-cards {
    grid-template-columns: repeat(4, 1fr); /* 4 строго равные колонки */
    max-width: 1400px;
    align-items: stretch; /* Одинаковая высота */
    width: 100%; /* Занимаем всю доступную ширину */
}

#individual-plans .pricing-card {
    min-height: 500px; /* Минимальная высота */
    max-width: 100%; /* Не выходим за пределы колонки */
    width: 100%; /* Занимаем всю ширину колонки */
}

/* Individual plans: 4 cards in one row */
#individual-plans .pricing-cards {
    grid-template-columns: repeat(4, 1fr); /* 4 строго равные колонки */
    max-width: 1400px;
    align-items: stretch; /* Одинаковая высота */
    width: 100%; /* Занимаем всю доступную ширину */
}

#individual-plans .pricing-card {
    min-height: 500px; /* Минимальная высота */
    max-width: 100%; /* Не выходим за пределы колонки */
    width: 100%; /* Занимаем всю ширину колонки */
}

/* Studio plans: 4 cards in one row */
#studio-plans .pricing-cards {
    grid-template-columns: repeat(4, 1fr); /* 4 строго равные колонки */
    max-width: 1400px;
    align-items: stretch; /* Одинаковая высота */
    width: 100%; /* Занимаем всю доступную ширину */
}

#studio-plans .pricing-card {
    min-height: 600px; /* Минимальная высота (больше чем у индивидуальных) */
    max-width: 100%; /* Не выходим за пределы колонки */
    width: 100%; /* Занимаем всю ширину колонки */
}

.pricing-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2.5rem 2rem;
    border: 2px solid var(--border-color);
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%; /* Растягивается на всю высоту */
    box-sizing: border-box; /* Учитываем padding и border в размерах */
}

/* Уникальные тени для каждого тарифа */
#individual-plans .pricing-card:nth-child(1):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(139, 92, 246, 0.15),
        0 2px 8px rgba(139, 92, 246, 0.1);
    border-color: rgba(139, 92, 246, 0.3);
}

#individual-plans .pricing-card:nth-child(2):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(59, 130, 246, 0.15),
        0 2px 8px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

#individual-plans .pricing-card:nth-child(3):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(16, 185, 129, 0.15),
        0 2px 8px rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

#individual-plans .pricing-card:nth-child(4):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(245, 158, 11, 0.15),
        0 2px 8px rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

/* Уникальные тени для студийных тарифов */
#studio-plans .pricing-card:nth-child(1):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(59, 130, 246, 0.15),
        0 2px 8px rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

#studio-plans .pricing-card:nth-child(2):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(16, 185, 129, 0.15),
        0 2px 8px rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

#studio-plans .pricing-card:nth-child(3):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(245, 158, 11, 0.15),
        0 2px 8px rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

#studio-plans .pricing-card:nth-child(4):hover {
    transform: translateY(-8px);
    box-shadow: 
        0 8px 32px rgba(236, 72, 153, 0.15),
        0 2px 8px rgba(236, 72, 153, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(102, 126, 234, 0.5);
}

.pricing-card.popular {
    border-color: var(--primary-purple);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05), rgba(245, 87, 108, 0.05));
}

.pricing-card.popular::before {
    content: attr(data-badge);
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.3),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.pricing-card.popular:hover::before {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 1px rgba(255, 255, 255, 0.35),
        inset 0 -1px 1px rgba(0, 0, 0, 0.1);
}

.pricing-header-section {
    text-align: center;
    margin-bottom: 2rem;
}

.pricing-tier {
    font-size: 1.5rem;
    font-weight: 700;
    min-height: 3.5rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.pricing-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.15rem; /* Уменьшили ещё больше */
    margin-bottom: 1rem;
    max-width: 320px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: nowrap; /* Все в одну строку */
}

.pricing-amount {
    font-size: 2rem; /* Уменьшили для четырёхзначных чисел как было у Enterprise */
    font-weight: 800;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    max-width: 100%; /* Не выходит за пределы */
    overflow-wrap: break-word; /* Переносит длинные слова */
    word-break: break-word; /* Разрывает слова если нужно */
    hyphens: auto; /* Автоматические переносы */
}

.pricing-currency {
    font-size: 1.5rem; /* Делаем компактными как было у Enterprise */
    font-weight: 700;
    color: var(--text-muted);
}

.pricing-prefix {
    font-size: 0.875rem; /* Маленький размер, как у периода */
    font-weight: 500;
    color: var(--text-dim);
    margin-right: 0.1rem;
}

.pricing-period {
    color: var(--text-dim);
    font-size: 0.875rem;
}

.pricing-description {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 1.25rem; /* Уменьшаем отступ для поднятия списка функций */
    min-height: 48px; /* Фиксированная высота для выравнивания (2 строки текста) */
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Features List ========== */
.pricing-features {
    flex-grow: 1;
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
}

.pricing-features h4 {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-dim);
    margin-bottom: 1rem;
    display: none; /* Скрываем заголовок */
}

.features-list {
    list-style: none;
    flex-grow: 1;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.5rem 0; /* Уменьшаем отступы для компактности */
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    min-height: 60px; /* Увеличиваем для текстов в 2-3 строки */
}

.feature-item:first-child {
    padding-top: 0; /* Убираем отступ сверху у первого элемента */
}

.feature-item:last-child {
    border-bottom: none;
}

.feature-icon {
    color: var(--primary-purple);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.feature-text {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
}

.feature-value {
    font-weight: 600;
    color: var(--text-light);
}

/* Disabled/unavailable features */
.feature-item.disabled {
    opacity: 0.4;
}

.feature-item.disabled .feature-icon {
    color: var(--text-dim);
}

.feature-item.disabled .feature-text {
    text-decoration: line-through;
    color: var(--text-dim);
}

.feature-disabled {
    opacity: 0.4;
}

.feature-disabled .feature-icon {
    color: var(--text-dim);
}

/* ========== Pricing Button ========== */
.pricing-btn {
    width: 100%;
    padding: 1.25rem;
    margin-top: auto; /* Прижимает кнопку к низу */
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 8px rgba(0, 0, 0, 0.1),
        inset 0 1px 1px rgba(255, 255, 255, 0.15),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
}

/* Живой эффект при наведении */
.pricing-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    transition: left 0.5s ease;
}

.pricing-btn:hover::before {
    left: 100%;
}

.pricing-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.15),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
    color: #ffffff;
}

.pricing-card.popular .pricing-btn {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.2),
        inset 0 -1px 1px rgba(0, 0, 0, 0.05);
}

.pricing-card.popular .pricing-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.pricing-btn-secondary {
    background: var(--card-hover);
    border: 2px solid var(--border-color);
}

.pricing-btn-secondary:hover {
    border-color: var(--primary-purple);
    background: rgba(102, 126, 234, 0.1);
}

/* ========== Comparison Table ========== */
.comparison-table {
    margin-top: 4rem;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
}

.comparison-table th,
.comparison-table td {
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.comparison-table th {
    background: var(--card-hover);
    font-weight: 700;
    color: var(--text-light);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.comparison-table td {
    color: var(--text-muted);
}

.comparison-table .check {
    color: var(--primary-purple);
    font-size: 1.25rem;
}

.comparison-table .cross {
    color: var(--text-dim);
    opacity: 0.5;
}

/* ========== Hide/Show Sections ========== */
.pricing-section {
    display: none;
}

.pricing-section.active {
    display: block;
}

/* ========== Payment Modal Specific ========== */
#payment-modal .modal-content {
    max-width: 450px;
}

.payment-summary {
    background: var(--gradient-subtle);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.payment-summary h4 {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.payment-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.payment-summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-weight: 700;
    font-size: 1.25rem;
}

.payment-summary-total .amount {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-methods .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

/* Дополнительный отступ справа только для кнопок с badge */
.payment-methods .btn:has(.badge) {
    padding-right: 5.5rem;
}

.payment-methods .btn-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.payment-methods .badge {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.65rem;
    padding: 0.25rem 0.6rem;
    white-space: nowrap;
}

/* ========== Responsive Pricing ========== */

/* Tablet: keep desktop layout */
@media (max-width: 1200px) and (min-width: 769px) {
    /* Планшеты: сохраняем сетку 2x2 */
    #individual-plans .pricing-cards,
    #studio-plans .pricing-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile: horizontal swipe */
@media (max-width: 768px) {
    /* Простой ползунок для мобильных */
    .pricing-toggle {
        /* Оставляем inline-flex чтобы text-align: center работал! */
        width: auto;
        max-width: 90%;
        padding: 4px;
        gap: 4px;
    }
    
    /* Убираем анимированный ползунок на мобильных */
    .pricing-toggle::before {
        display: none !important;
    }
    
    .toggle-btn {
        flex: 1; /* Каждая кнопка занимает 50% */
        min-width: 140px; /* Минимальная ширина для читаемости */
        padding: 0.75rem 0.5rem;
        font-size: 0.9rem;
        background: transparent !important;
        border-radius: 10px;
        transition: all 0.3s ease;
        color: var(--text-muted) !important;
    }
    
    /* Активная кнопка имеет фон - усиливаем специфичность */
    .pricing-toggle .toggle-btn.active {
        background: rgba(255, 255, 255, 0.15) !important;
        color: #ffffff !important;
        border: 1px solid rgba(255, 255, 255, 0.2);
    }
    
    .btn-content {
        gap: 4px;
    }
    
    .btn-icon {
        font-size: 0.85rem;
        width: 14px;
        height: 14px;
    }
    
    .model-count-selector {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    
    .model-count-btn {
        width: 100%;
        padding: 0.85rem 1rem;
        font-size: 0.95rem;
    }
    
    /* Горизонтальный свайп для карточек */
    .pricing-cards {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 1rem;
        padding: 1rem 0 3rem 0; /* Добавлен отступ снизу для подсказки */
        margin: 0 -1rem; /* Компенсируем padding контейнера */
        padding-left: 1rem;
        padding-right: 1rem;
        position: relative;
    }
    
    /* Подсказка свайпа */
    .pricing-cards::after {
        content: '← Свайп →';
        position: absolute;
        bottom: -2rem;
        left: 50%;
        transform: translateX(-50%);
        color: var(--text-dim);
        font-size: 0.875rem;
        opacity: 0.7;
        animation: swipeHint 2s ease-in-out infinite;
        pointer-events: none;
    }
    
    @keyframes swipeHint {
        0%, 100% { opacity: 0.7; }
        50% { opacity: 0.3; }
    }
    
    .pricing-card {
        flex: 0 0 85%; /* Карточка занимает 85% ширины экрана */
        scroll-snap-align: center;
        margin-bottom: 0;
        max-width: 400px;
    }
    
    /* Индикатор прокрутки */
    .pricing-cards::-webkit-scrollbar {
        height: 4px;
    }
    
    .pricing-cards::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.05);
        border-radius: 10px;
    }
    
    .pricing-cards::-webkit-scrollbar-thumb {
        background: rgba(102, 126, 234, 0.5);
        border-radius: 10px;
    }
    
    .pricing-amount {
        font-size: 2rem;
    }
    
    .comparison-table {
        font-size: 0.875rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* ========== Enterprise Request Modal ========== */
#enterprise-modal .modal-content {
    max-width: 500px;
}

.enterprise-info {
    background: rgba(102, 126, 234, 0.1);
    border: 1px solid rgba(102, 126, 234, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.btn-full {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    font-size: 1rem;
    padding: 1rem;
}

.enterprise-success {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.enterprise-success h4 {
    color: var(--text-light);
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
}

.enterprise-success p {
    color: var(--text-muted);
    line-height: 1.6;
}
