/* ============================================
   RUSVPN Pricing Page Styles
   Unified with Main Site Design
   ============================================ */

/* Body background - solid dark color, no pattern */
body.pricing-page {
    background: var(--bg-primary) !important;
}

/* Header (top navigation) - 20% transparency */
body.pricing-page header {
    background: rgba(15, 23, 42, 0.8) !important;
}

/* Make main and content use default backgrounds */
body.pricing-page main,
body.pricing-page #content {
    background: transparent !important;
}

/* ============================================
   Pricing Header - With Hero Background (Hacker Image)
   ============================================ */
.pricing-header {
    padding: 120px 1rem 80px;
    min-height: 420px;
    text-align: center;
    background: 
        linear-gradient(135deg, rgba(0, 217, 126, 0.15) 0%, rgba(59, 130, 246, 0.15) 100%),
        #0f172a;
    position: relative;
    border-bottom: 2px solid var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pricing-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/assets/images/hero-bg.png') center center / cover no-repeat;
    opacity: 0.15;
    z-index: 0;
}

.pricing-header .container {
    position: relative;
    z-index: 1;
}

.pricing-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.pricing-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
}

/* ============================================
   Plans Section - Alternating backgrounds like homepage
   ============================================ */
.pricing-plans {
    padding: 0 1rem 3rem;
    background: transparent;
}

/* Personal plans - dark background (like .features on homepage) */
.pricing-plans.personal-plans {
    background: transparent !important;
    border-bottom: 2px solid var(--primary);
}

/* Corporate plans - semi-transparent with blur overlay */
.pricing-plans.corporate-plans {
    background: transparent;
    border-bottom: 2px solid var(--primary);
    position: relative;
}

.pricing-plans.corporate-plans::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(20, 25, 30, 0.1);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 0;
    pointer-events: none;
}

.pricing-plans.corporate-plans .container {
    position: relative;
    z-index: 1;
}

.plans-category-title {
    font-size: 1.18125rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 2rem;
    padding-top: 2rem;
    color: var(--text-primary);
}

/* ============================================
   Plans Grid - Equal Height Cards
   ============================================ */
.plans-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding-top: 0;
    align-items: stretch;
}

/* Tablet: 2 columns */
@media (min-width: 640px) {
    .plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 3 columns for personal, 3 for corporate */
@media (min-width: 1024px) {
    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
        justify-content: center;
    }
    
    /* Personal plans: taller cards */
    .personal-plans .plans-grid .pricing-card {
        min-height: 560px;
    }
    
    .plans-grid.corporate-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 1200px;
    }
}

/* ============================================
   Pricing Card - Unified Design
   ============================================ */
.pricing-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.75rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 1s ease;
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 420px;
    overflow: hidden;
}

/* Bounce animation on hover - realistic ball physics WITHOUT scale */
@keyframes cardBounce {
    0% {
        transform: translateY(0);
        animation-timing-function: cubic-bezier(0.33, 1, 0.68, 1); /* Ease out - slowing down at top */
    }
    50% {
        transform: translateY(-13.5px); /* 1.5x higher amplitude */
        animation-timing-function: cubic-bezier(0.32, 0, 0.67, 0); /* Ease in - accelerating down */
    }
    100% {
        transform: translateY(0);
    }
}

/* Background image layer - can be smoothly scaled */
.pricing-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 0;
    border-radius: 12px;
    transition: transform 1s ease;
}

/* Dark overlay above background */
.pricing-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
    border-radius: 12px;
    pointer-events: none;
    transition: background 1s ease;
}

/* Hover effect - smooth scale to 1.1 over 1 second */
.pricing-card:hover {
    border-color: var(--primary);
    box-shadow: 0 8px 24px rgba(0, 217, 126, 0.15);
    transform: scale(1.1);
}

.pricing-card:hover::before {
    transform: scale(1.5);
}

.pricing-card:hover::after {
    background: rgba(0, 0, 0, 0.4);
}

/* Content above overlay */
.pricing-card > * {
    position: relative;
    z-index: 2;
}

/* Plan-specific backgrounds */
.pricing-card[data-plan="basic"]::before {
    background-image: url('/assets/images/pricing/bazoviy.png');
}

.pricing-card[data-plan="standard"]::before {
    background-image: url('/assets/images/pricing/standart.png');
}

.pricing-card[data-plan="optimal"]::before {
    background-image: url('/assets/images/pricing/optimal.png');
}

.pricing-card[data-plan="professional"]::before {
    background-image: url('/assets/images/pricing/profi-1.png');
}

.pricing-card[data-plan="business"]::before {
    background-image: url('/assets/images/pricing/bisness.png');
}

.pricing-card[data-plan="corporate"]::before {
    background-image: url('/assets/images/pricing/corporativniy.png');
}

.pricing-card.featured {
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(0, 217, 126, 0.2);
}

/* Featured card top border - using a different approach since ::before is used for background */
.pricing-card.featured {
    border-top: 3px solid var(--primary);
}

/* Badge */
.plan-badge {
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--bg-primary);
    padding: 0.4rem 1.25rem;
    border-radius: 0 0 20px 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 217, 126, 0.3);
    white-space: nowrap;
    z-index: 20;
}

.plan-badge.badge-popular {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

.plan-badge.badge-best-offer {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    box-shadow: 0 4px 12px rgba(0, 217, 126, 0.4);
}

/* Plan Header */
.plan-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    padding-top: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.plan-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.plan-price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.price-amount {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
    text-shadow: 0 0 20px rgba(0, 217, 126, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-currency {
    font-size: 1.5rem;
    color: var(--primary);
    font-weight: 600;
    text-shadow: 0 0 20px rgba(0, 217, 126, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
}

.price-period {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.plan-devices {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Plan Features */
.plan-features {
    flex: 1;
    margin-bottom: 1.5rem;
    list-style: none;
    padding: 0;
}

.plan-features li,
.feature-item {
    padding: 0.625rem 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    line-height: 1.5;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.plan-features li::before,
.feature-icon {
    content: '✓';
    color: var(--primary);
    font-weight: 700;
    font-size: 1.25rem;
    flex-shrink: 0;
    line-height: 1;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.feature-text {
    color: rgba(255, 255, 255, 0.95);
    flex: 1;
}

/* Plan Action */
.plan-action {
    margin-top: auto;
    text-align: center;
}

.btn-select-plan {
    width: auto;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.03125rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    backdrop-filter: blur(10px);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

/* Shine effect animation - horizontal only */
@keyframes shine {
    0% {
        left: -150%;
    }
    100% {
        left: 250%;
    }
}

.btn-select-plan::before {
    content: '';
    position: absolute;
    top: -100%;
    left: -150%;
    width: 40px;
    height: 400%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.5),
        transparent
    );
    transform: skewX(-25deg);
    animation: shine 3s infinite;
    pointer-events: none;
}

/* Async delays for each button */
.pricing-card:nth-child(1) .btn-select-plan::before {
    animation-delay: 0s;
}

.pricing-card:nth-child(2) .btn-select-plan::before {
    animation-delay: 0.5s;
}

.pricing-card:nth-child(3) .btn-select-plan::before {
    animation-delay: 1s;
}

.pricing-card:nth-child(4) .btn-select-plan::before {
    animation-delay: 1.5s;
}

.pricing-card:nth-child(5) .btn-select-plan::before {
    animation-delay: 2s;
}

.pricing-card:nth-child(6) .btn-select-plan::before {
    animation-delay: 2.5s;
}

.btn-select-plan:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 217, 126, 0.5);
    transform: translateY(-2px);
}

.pricing-card.featured .btn-select-plan {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

.pricing-card.featured .btn-select-plan:hover {
    background: var(--primary-dark);
    box-shadow: 0 6px 16px rgba(0, 217, 126, 0.6);
}

/* Corporate Card Styling */
.corporate-card {
    /* Green border only on hover, not by default */
}

.corporate-card:hover {
    border-color: var(--primary);
}

.corporate-card .plan-name {
    color: #ffffff;
}

.corporate-card .price-amount,
.corporate-card .price-currency {
    color: var(--primary);
    text-shadow: 0 0 20px rgba(0, 217, 126, 0.6), 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
    .pricing-header {
        padding: 60px 1rem 2.5rem;
        min-height: 300px;
    }
    
    .pricing-title {
        font-size: 1.75rem;
    }
    
    .pricing-subtitle {
        font-size: 0.9375rem;
    }
    
    .plans-category-title {
        font-size: 1.18125rem;
    }
    
    .pricing-card {
        min-height: 380px;
    }
    
    .price-amount {
        font-size: 2rem;
    }

    /* CSS scroll-snap carousel for plans-grid on mobile */
    .pricing-plans {
        overflow: visible !important;
    }

    .pricing-plans .container {
        overflow: visible !important;
    }

    .plans-grid {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: stretch !important;
        gap: 16px !important;
        overflow-x: auto !important;
        overflow-y: visible !important;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding: 0 1rem 1rem;
    }

    .plans-grid::-webkit-scrollbar {
        display: none;
    }

    .plans-grid .pricing-card {
        flex: 0 0 80%;
        min-width: 0;
        min-height: 0 !important;
        height: auto !important;
        align-self: flex-start;
        scroll-snap-align: center;
        overflow: visible;
        /* Disable hover scale inside carousel */
        transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
    }

    /* Restore clip for pseudo-elements background */
    .plans-grid .pricing-card::before,
    .plans-grid .pricing-card::after {
        border-radius: 12px;
        overflow: hidden;
    }

    .plans-grid .pricing-card:hover {
        transform: none !important;
    }

    .plans-grid .pricing-card::before {
        transition: none !important;
    }

    .plans-grid .pricing-card:hover::before {
        transform: none !important;
    }

    .plans-grid .pricing-card:hover {
        transform: none !important;
    }

    .plans-grid .pricing-card::before {
        transition: none !important;
    }

    .plans-grid .pricing-card:hover::before {
        transform: none !important;
    }
}

/* Tablet */
@media (min-width: 640px) {
    .pricing-header {
        padding: 120px 2rem 80px;
    }
    
    .pricing-plans {
        padding: 0 2rem 4rem;
    }
    
    .pricing-card {
        padding: 2rem;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .pricing-title {
        font-size: 2.5rem;
    }
    
    .pricing-subtitle {
        font-size: 1.25rem;
    }
    
    .plans-category-title {
        font-size: 1.18125rem;
    }
}

/* ============================================
   Matrix Canvas Background
   ============================================ */
.matrix-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ============================================
   Accessibility
   ============================================ */
.btn-select-plan:focus {
    outline: 3px solid var(--primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* ============================================
   Features Comparison Section - Dark background with green border
   ============================================ */
.pricing-features-comparison {
    padding: 4rem 1rem;
    background: transparent !important;
    border-bottom: 2px solid var(--primary);
}

/* Footer - Gray Background with 20% transparency */
body.pricing-page footer {
    background: rgba(30, 41, 59, 0.8) !important;
}

.comparison-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--text-primary);
}

.comparison-note {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(30, 38, 46, 0.35);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

.comparison-note p {
    font-size: 1.125rem;
    color: var(--text-primary);
    margin-bottom: 1.25rem;
    padding-left: 0.5rem;
    line-height: 1.6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.comparison-note p:last-child {
    margin-bottom: 0;
}

.comparison-note p::before {
    content: '✓';
    color: var(--primary);
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
    text-shadow: 0 0 10px rgba(0, 217, 126, 0.5);
}

@media (max-width: 768px) {
    .pricing-features-comparison {
        padding: 3rem 1rem;
    }
    
    .comparison-title {
        font-size: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .comparison-note {
        padding: 1.5rem;
    }
    
    .comparison-note p {
        font-size: 1rem;
    }
}

/* === HERO FIX OVERRIDE: match home page .hero behavior === */

/* Desktop: use cover background like .hero, with padding for fixed header */
.pricing-header {
    background: url('/assets/images/hero-bg.png') center center / cover no-repeat !important;
    padding: 190px 1rem 80px !important; /* 70px fixed header + 120px visible space */
    min-height: 500px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Dark overlay — same opacity as .hero::before */
.pricing-header::before {
    background: rgba(15, 20, 25, 0.65) !important;
    opacity: 1 !important;
}

/* Mobile: 2-row header is ~120px tall */
@media (max-width: 768px) {
    /* FIX: compensate for 2-row fixed header */
    .pricing-header {
        padding: 60px 1rem 3rem !important;
        min-height: 300px !important;
    }

    /* Disable hover scale on touch devices */
    .pricing-card:hover {
        transform: none !important;
    }

    .pricing-card:hover::before {
        transform: none !important;
    }
}

/* === END HERO FIX === */

/* === DESKTOP OVERFLOW FIX ===
   mobile-fixes.css sets .container { overflow-x: hidden } globally,
   which clips cards on hover scale(1.1). Override for pricing page on desktop. */
@media (min-width: 769px) {
    .pricing-plans .container,
    .pricing-plans,
    .plans-grid {
        overflow: visible !important;
    }
}
/* === END DESKTOP OVERFLOW FIX === */

/* ============================================
   Coming Soon Cards - Бизнес и Корпоративный
   ============================================ */
.pricing-card.coming-soon {
    opacity: 0.45;
    filter: grayscale(30%);
    pointer-events: none;
    cursor: default;
}

.pricing-card.coming-soon::after {
    background: rgba(0, 0, 0, 0.72) !important;
}

.pricing-card.coming-soon:hover {
    transform: none !important;
    border-color: var(--border) !important;
    box-shadow: none !important;
}

.pricing-card.coming-soon:hover::before {
    transform: none !important;
}

.btn-coming-soon {
    width: auto;
    padding: 0.875rem 1.5rem;
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.45);
    border: 2px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1.03125rem;
    cursor: default;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    pointer-events: none;
}
