/* ========================================
   PRICING PAGE - MODERN SAAS UI
   Production-ready CSS
   ======================================== */

/* =========================
   PRICING HERO SECTION
   ========================= */
.pricing-hero {
    background: linear-gradient(135deg, #f9fafb 0%, #ffffff 100%);
    padding: 4rem 0 3rem;
    text-align: center;
    position: relative;
}

.pricing-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

.pricing-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.pricing-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

/* =========================
   BILLING TOGGLE
   ========================= */
.billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 1.25rem;
    background: var(--color-white);
    padding: 0.5rem;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--color-border);
}

.billing-option {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.billing-option input[type="radio"] {
    display: none;
}

.billing-option label {
    padding: 0.625rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.billing-option input[type="radio"]:checked + label {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

.save-badge {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.billing-option input[type="radio"]:checked + label .save-badge {
    background: rgba(255, 255, 255, 0.2);
    color: var(--color-white);
}

/* Toggle Switch Visual */
.toggle-switch {
    position: relative;
    width: 52px;
    height: 28px;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: absolute;
    inset: 0;
    background: var(--color-border);
    border-radius: var(--radius-full);
    cursor: pointer;
    transition: all 0.3s ease;
}

.toggle-slider {
    position: absolute;
    width: 22px;
    height: 22px;
    background: var(--color-white);
    border-radius: var(--radius-full);
    left: 3px;
    top: 3px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.toggle-input:checked + .toggle-label {
    background: var(--color-primary);
}

.toggle-input:checked + .toggle-label .toggle-slider {
    transform: translateX(24px);
}

/* =========================
   PRICING CARDS SECTION
   ========================= */
.pricing-cards {
    padding: 4rem 0;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    align-items: start;
    max-width: 1200px;
    margin: 0 auto;
}

/* =========================
   PRICING CARD
   ========================= */
.pricing-card {
    background: var(--color-white);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.pricing-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* Highlighted card (Professional - Most Popular) */
.pricing-card.highlighted {
    border-color: var(--color-primary);
    border-width: 3px;
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.2);
    z-index: 2;
}

.pricing-card.highlighted:hover {
    transform: scale(1.05) translateY(-8px);
    box-shadow: 0 16px 40px rgba(99, 102, 241, 0.25);
}

/* Card Badges */
.card-badge {
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.popular-badge {
    background: var(--color-primary);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.premium-badge {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
}

.free-badge {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: var(--color-white);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

/* Card Header */
.card-header {
    text-align: center;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.plan-name {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 0.5rem;
}

.plan-tagline {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.5;
}

/* Pricing */
.card-price {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--color-light);
}

.price-container {
    display: flex;
    align-items: baseline;
    justify-content: center;
    margin-bottom: 0.5rem;
}

.price-amount {
    font-size: 3rem;
    font-weight: 800;
    color: var(--color-dark);
    line-height: 1;
}

.price-currency {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-text-muted);
    margin-left: 0.25rem;
}

.price-period {
    font-size: 1rem;
    color: var(--color-text-muted);
    margin-left: 0.25rem;
}

.price-savings,
.price-note {
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.price-savings {
    color: #059669;
    font-weight: 600;
}

/* Annual only elements */
.annual-only {
    display: none;
}

body.billing-annual .annual-only {
    display: block;
}

/* Trial Banner */
.trial-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(99, 102, 241, 0.05) 100%);
    color: var(--color-primary);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Feature List */
.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
    flex: 1;
}

.feature-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.875rem;
    color: var(--color-text);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.feature-list li svg {
    flex-shrink: 0;
    margin-top: 0.125rem;
    color: var(--color-primary);
}

.feature-list li.feature-unavailable {
    opacity: 0.5;
}

.feature-list li.feature-unavailable svg {
    color: var(--color-error);
}

/* Plan Buttons */
.btn-plan {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    border-radius: var(--radius-lg);
    font-weight: 700;
    font-size: 1rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    cursor: pointer;
    margin-top: auto;
    font-family: inherit;
}

.btn-plan.btn-disabled,
.btn-plan:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: var(--color-border);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}

.btn-plan.btn-disabled:hover,
.btn-plan:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-professional {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.btn-professional:hover {
    background: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.3);
}

.btn-premium {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%);
    color: var(--color-white);
}

.btn-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.4);
}

.btn-free {
    background: transparent;
    color: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-free:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

/* =========================
   COMPARISON TABLE SECTION
   ========================= */
.comparison-section {
    padding: 5rem 0;
    background: var(--color-light);
}

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

.comparison-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-dark);
    margin-bottom: 0.75rem;
}

.comparison-subtitle {
    font-size: 1.0625rem;
    color: var(--color-text-muted);
}

.table-wrapper {
    overflow-x: auto;
    background: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9375rem;
}

.comparison-table thead th {
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    padding: 1.25rem 1rem;
    font-weight: 700;
    color: var(--color-dark);
    text-align: center;
    border-bottom: 2px solid var(--color-border);
    text-transform: uppercase;
    font-size: 0.8125rem;
    letter-spacing: 0.05em;
}

.comparison-table thead th.feature-col {
    text-align: left;
    width: 30%;
}

.comparison-table tbody td {
    padding: 1rem;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    color: var(--color-text);
}

.comparison-table tbody td.feature-name {
    text-align: left;
    font-weight: 600;
    color: var(--color-dark);
}

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

.comparison-table tbody tr:hover {
    background: rgba(99, 102, 241, 0.02);
}

.highlighted-col {
    background: rgba(99, 102, 241, 0.05);
}

.highlighted-cell {
    background: rgba(99, 102, 241, 0.05);
    font-weight: 600;
    color: var(--color-primary);
}

.comparison-table .unavailable {
    color: var(--color-text-muted);
    opacity: 0.6;
}

.comparison-table .available {
    color: var(--color-success);
    font-size: 1.125rem;
}

/* =========================
   PRICING FAQ
   ========================= */
.pricing-faq {
    padding: 5rem 0;
}

.faq-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-dark);
    text-align: center;
    margin-bottom: 3rem;
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
    max-width: 1000px;
    margin: 0 auto;
}

.faq-item {
    background: var(--color-white);
    padding: 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-border);
    transition: all 0.2s ease;
}

.faq-item:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.faq-item h3 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--color-dark);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.faq-item p {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* =========================
   PRICING CTA
   ========================= */
.pricing-cta {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 5rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.pricing-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.3;
    animation: gridMove 20s linear infinite;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }
    100% {
        transform: translate(50px, 50px);
    }
}

.cta-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.cta-content h2 {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--color-white);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.cta-content p {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.0625rem;
    font-weight: 700;
}

.btn-outline {
    background: transparent;
    color: var(--color-white);
    border: 2px solid var(--color-white);
}

.btn-outline:hover {
    background: var(--color-white);
    color: var(--color-primary);
}

/* =========================
   RESPONSIVE DESIGN
   ========================= */

/* Tablets (1024px and below) */
@media (max-width: 1024px) {
    .pricing-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }

    .pricing-card.highlighted {
        transform: scale(1.02);
    }

    .pricing-card.highlighted:hover {
        transform: scale(1.02) translateY(-8px);
    }
}

/* Mobile landscape (768px and below) */
@media (max-width: 768px) {
    .pricing-title {
        font-size: 2rem;
    }

    .pricing-subtitle {
        font-size: 1rem;
    }

    .billing-toggle {
        flex-direction: column;
        width: 100%;
        max-width: 320px;
        margin: 0 auto;
        gap: 0.5rem;
    }

    .billing-option {
        width: 100%;
    }

    .billing-option label {
        width: 100%;
        justify-content: center;
    }

    .toggle-switch {
        display: none;
    }

    .pricing-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .pricing-card {
        transform: none !important;
    }

    .pricing-card.highlighted {
        transform: none !important;
    }

    .pricing-card.highlighted:hover {
        transform: translateY(-4px) !important;
    }

    .price-amount {
        font-size: 2.5rem;
    }

    .price-currency {
        font-size: 1.5rem;
    }

    .comparison-table {
        font-size: 0.875rem;
    }

    .comparison-table thead th,
    .comparison-table tbody td {
        padding: 0.75rem 0.5rem;
    }

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

    .cta-content h2 {
        font-size: 2rem;
    }

    .cta-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-large {
        width: 100%;
    }
}

/* Mobile portrait (480px and below) */
@media (max-width: 480px) {
    .pricing-hero {
        padding: 2.5rem 0 2rem;
    }

    .pricing-title {
        font-size: 1.75rem;
    }

    .pricing-subtitle {
        font-size: 0.9375rem;
    }

    .pricing-cards {
        padding: 2.5rem 0;
    }

    .pricing-card {
        padding: 1.5rem;
    }

    .plan-name {
        font-size: 1.5rem;
    }

    .price-amount {
        font-size: 2.25rem;
    }

    .feature-list li {
        font-size: 0.875rem;
    }

    .comparison-section,
    .pricing-faq,
    .pricing-cta {
        padding: 3rem 0;
    }

    .comparison-title,
    .faq-title {
        font-size: 1.75rem;
    }

    .cta-content h2 {
        font-size: 1.75rem;
    }

    .cta-content p {
        font-size: 1rem;
    }
}

/* =========================
   ACCESSIBILITY
   ========================= */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .pricing-card {
        border-width: 3px;
    }

    .pricing-card.highlighted {
        border-width: 4px;
    }
}

/* =========================
   PAYMENT PROVIDER BUTTONS
   ========================= */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: auto;
}

.btn-plan {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* PayPal Button Styling */
.btn-paypal {
    background: #0070ba;
    color: var(--color-white);
    border-color: #0070ba;
    font-size: 0.9375rem;
}

.btn-paypal:hover {
    background: #005ea6;
    border-color: #005ea6;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 112, 186, 0.3);
}

.btn-paypal svg {
    flex-shrink: 0;
}

/* Primary button (Stripe) gets slight visual priority */
.btn-plan.btn-primary {
    /* Maintains original styling */
}

/* Optional: Show "or" between buttons */
.button-group::after {
    content: '';
    height: 1px;
    background: transparent;
}

/* Responsive adjustments for button group */
@media (max-width: 768px) {
    .button-group {
        gap: 0.625rem;
    }

    .btn-plan {
        padding: 0.875rem 1.25rem;
        font-size: 0.9375rem;
    }

    .btn-plan svg {
        width: 16px;
        height: 16px;
    }
}

/* Print styles */
@media print {
    .billing-toggle,
    .btn-plan,
    .cta-buttons,
    .pricing-cta,
    .button-group {
        display: none !important;
    }

    .pricing-card {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #000;
    }

    .comparison-table {
        page-break-inside: avoid;
    }
}
