/* Plans Selection Page Specific Styles */
/* shared-components.css loaded via base.html */

/* Header cost amount – purple theme (this file is only loaded on plans page) */
.page-header .cost-display .cost-amount {
    color: var(--color-main);
}

/* Selected Network Info */
.selected-network-info {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.network-badge {
    background: linear-gradient(135deg, var(--color-success) 0%, #059669 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 25px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    transition: all 0.3s ease;
}

.network-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.network-badge i {
    font-size: 1.1rem;
}

/* Plans Selection Grid */
.plans-selection {
    margin-bottom: 3rem;
}

.plans-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: auto;
    gap: 1.5rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Center cards when there are fewer than 4 without stretching */
.plans-grid:has(.plan-card:nth-child(1):last-child) {
    grid-template-columns: 300px;
    justify-content: center;
}

.plans-grid:has(.plan-card:nth-child(2):last-child) {
    grid-template-columns: repeat(2, 300px);
    justify-content: center;
}

.plans-grid:has(.plan-card:nth-child(3):last-child) {
    grid-template-columns: repeat(3, 300px);
    justify-content: center;
}

/* Plan Card Styling */
.plan-card {
    /* Extends .wizard-card base class */
    display: grid;
    grid-row: span 8;
    grid-template-rows: subgrid;
    position: relative;
    overflow: visible;
    padding: 1.25rem;
    animation: fadeInUp 0.8s ease-out both;
    box-sizing: border-box;
    z-index: 1;
}

.plan-card:nth-child(1) { animation-delay: 0.6s; }
.plan-card:nth-child(2) { animation-delay: 0.8s; }
.plan-card:nth-child(3) { animation-delay: 1.0s; }
.plan-card:nth-child(4) { animation-delay: 1.2s; }

.plan-card:hover {
    border-color: var(--color-main-light);
    transform: translateY(-4px);
    box-shadow:
        0 16px 48px rgba(139, 92, 246, 0.15),
        0 6px 24px rgba(0, 0, 0, 0.08),
        0 0 0 1px rgba(139, 92, 246, 0.1);
}

/* Plan Header */
.plan-header {
    margin-bottom: 1.5rem;
    position: relative;
}

.plan-badge {
    background: var(--gradient-main);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    display: inline-block;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.plan-network {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 1rem;
}

.plan-network-logo {
    max-height: 40px;
    max-width: 100px;
    object-fit: contain;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Plan Content */
.plan-content {
    display: grid;
    grid-row: span 8;
    grid-template-rows: subgrid;
    gap: 0.6rem;
}

/* Plan Logo Section */
.plan-logo {
    text-align: center;
}

/* Plan Data Section */
.plan-data {
    text-align: center;
}

.data-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.data-label {
    font-size: 0.9rem;
    color: var(--color-text-body);
    font-weight: 600;
    letter-spacing: 0.1em;
}

/* Plan Features */

/* Feature items - using shared component */

/* Plan Pricing -- gradient box matching devices/addons */
.plan-pricing {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.05) 0%, rgba(107, 38, 212, 0.03) 100%);
    border-radius: 10px;
    padding: 0.65rem 0.75rem;
    margin-bottom: 0;
    text-align: center;
}

.plan-pricing .price-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-body);
    margin-bottom: 0.2rem;
    letter-spacing: 0.02em;
}

.plan-pricing .price {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-main);
    line-height: 1;
}



/* Lines Counter -- compact size matching devices/addons */
.plan-card .lines-counter {
    justify-self: center;
    width: auto;
    min-width: 160px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    padding-top: 0.65rem;
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.plan-card .lines-input {
    width: 60px;
}

/* Plan Additional Info */
.plan-additional-info {

    text-align: left;
}

.plan-additional-info h4 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 0.75rem;
}

.additional-features {
    margin-bottom: 1rem;
}

.additional-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.additional-feature i {
    color: var(--color-success);
    font-size: 0.9rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.additional-feature span {
    font-size: 0.7rem;
    color: var(--color-text-body);
    line-height: 1.4;
}

.cost-increase-info {
    border-top: 1px solid rgba(229, 231, 235, 0.5);
    padding-top: 1rem;
}

.cost-increase-info p {
    font-size: 0.75rem;
    color: var(--color-text-body);
    line-height: 1.4;
    margin: 0;
}




/* Choose Plan Button */
.choose-plan-btn {
    background: var(--gradient-main);
    color: white;
    border: none;
    padding: 0.6rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    width: 100%;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.choose-plan-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s ease, height 0.3s ease;
}

.choose-plan-btn:active::before {
    width: 300px;
    height: 300px;
}

.choose-plan-btn:hover {
    background: var(--gradient-main-hover);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.choose-plan-btn:active {
    transform: translateY(0) scale(0.98);
}

/* Plan Card Selected State - using shared component */

/* Responsive Design */
@media (max-width: 1200px) and (min-width: 1025px) {
    .plans-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.5rem;
        max-width: 1200px;
    }
    
    /* Center cards when there are fewer than 4 without stretching */
    .plans-grid:has(.plan-card:nth-child(1):last-child) {
        grid-template-columns: 280px;
        justify-content: center;
    }

    .plans-grid:has(.plan-card:nth-child(2):last-child) {
        grid-template-columns: repeat(2, 280px);
        justify-content: center;
    }

    .plans-grid:has(.plan-card:nth-child(3):last-child) {
        grid-template-columns: repeat(3, 280px);
        justify-content: center;
    }
}

@media (max-width: 1024px) {
    .plans-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
        max-width: 1000px;
        padding: 0 1rem;
    }
    
    /* Center cards when there are fewer than 3 without stretching */
    .plans-grid:has(.plan-card:nth-child(1):last-child) {
        grid-template-columns: 280px;
        justify-content: center;
    }

    .plans-grid:has(.plan-card:nth-child(2):last-child) {
        grid-template-columns: repeat(2, 280px);
        justify-content: center;
    }
}

@media (max-width: 800px) {
    .plans-grid {
        grid-template-columns: repeat(2, 280px);
        gap: 1.5rem;
        max-width: 100%;
        padding: 0 1rem;
        justify-content: center;
    }
    
    /* Center single card without stretching */
    .plans-grid:has(.plan-card:nth-child(1):last-child) {
        grid-template-columns: 280px;
        justify-content: center;
    }
    
    /* When there are 2 cards, keep them as 2 columns */
    .plans-grid:has(.plan-card:nth-child(2):last-child) {
        grid-template-columns: repeat(2, 280px);
        justify-content: center;
    }

    .plan-card {
        padding: 1.25rem;
    }

    .data-amount {
        font-size: 2rem;
    }

    .plan-pricing .price {
        font-size: 1.5rem;
    }

    .plan-additional-info {
        padding: 0.75rem;
    }
}

@media (max-width: 480px) {
    .plans-grid {
        grid-template-columns: 280px;
        gap: 1.5rem;
        max-width: 100%;
        padding: 0 1rem;
        justify-content: center;
    }
    
    /* Always center cards in mobile view */
    .plans-grid:has(.plan-card:nth-child(1):last-child),
    .plans-grid:has(.plan-card:nth-child(2):last-child),
    .plans-grid:has(.plan-card:nth-child(3):last-child) {
        grid-template-columns: 280px;
        justify-content: center;
    }

    .plan-card {
        padding: 1.5rem;
        max-width: 280px;
        width: 100%;
    }

    .selected-network-info {
        margin-bottom: 1.5rem;
    }

    .network-badge {
        padding: 0.6rem 1.2rem;
        font-size: 0.8rem;
    }

    .plan-additional-info h4 {
        font-size: 0.8rem;
    }

    .additional-feature span {
        font-size: 0.75rem;
    }

    .cost-increase-info p {
        font-size: 0.7rem;
    }
}

/* Enhanced animations for plan cards */
.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(
        90deg,
        transparent 0%,
        transparent 35%,
        rgba(139, 92, 246, 0.08) 50%,
        transparent 65%,
        transparent 100%
    );
    background-size: 200% 100%;
    background-position: 100% 0;
    transition: background-position 0.5s ease;
    pointer-events: none;
}

.plan-card:hover::before {
    background-position: 0% 0%;
}

/* Loading states */
.plan-card.loading {
    pointer-events: none;
    opacity: 0.7;
}

.plan-card.loading .choose-plan-btn {
    background: var(--color-text-muted);
    cursor: not-allowed;
}

.plan-card.loading .choose-plan-btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fallback Network Banner */
.fallback-network-banner {
    background: linear-gradient(135deg, rgba(120, 39, 230, 0.95) 0%, rgba(102, 58, 233, 0.95) 100%);
    backdrop-filter: blur(10px);
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 1px solid rgba(120, 39, 230, 0.3);
    box-shadow: 0 4px 20px rgba(120, 39, 230, 0.2);
    animation: slideDown 0.4s ease-out;
}

.fallback-network-banner i {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.fallback-network-banner p {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.4;
}

/* Animations - using shared component */
