/**
 * Plan Switcher Styles
 *
 * Styles for the NBN plan switching interface in My Account.
 * Follows Go Troppo design system with glass morphism effects.
 *
 * @package VocusOrderProcessor
 * @since 2.5.0
 */

/* ==========================================================================
   Plan Switcher Container
   ========================================================================== */

.vop-plan-switcher {
    margin: 30px 0;
    font-family: inherit;
}

.vop-plan-switcher .vop-section-header {
    margin-bottom: 24px;
}

.vop-plan-switcher .vop-section-header h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.vop-plan-switcher .vop-section-intro {
    color: #666;
    font-size: 0.95rem;
    margin: 0;
}

/* ==========================================================================
   Current Plan Card
   ========================================================================== */

.vop-current-plan-card {
    position: relative;
    background: linear-gradient(135deg, #20d6b4 0%, #0096c7 100%);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    color: #fff;
    box-shadow: 0 8px 32px rgba(32, 214, 180, 0.3);
}

.vop-current-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vop-current-plan-content {
    min-height: 80px;
}

.vop-current-plan-name {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.vop-current-plan-speeds {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
}

.vop-speed-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.95rem;
}

.vop-speed-arrow {
    font-weight: 700;
    font-size: 1.1rem;
}

.vop-current-plan-price {
    font-size: 1.25rem;
    font-weight: 600;
}

.vop-price-period {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
}

/* ==========================================================================
   Billing Period Toggle
   ========================================================================== */

.vop-billing-toggle {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 24px;
    padding: 4px;
    background: #f5f5f5;
    border-radius: 12px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
}

.vop-billing-btn {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: transparent;
    color: #666;
}

.vop-billing-btn:hover {
    color: #333;
}

.vop-billing-btn.active {
    background: #fff;
    color: #1a1a2e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Plans Container & Grid
   ========================================================================== */

.vop-plans-container {
    position: relative;
    padding: 0 40px;
}

.vop-plans-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.vop-plans-grid::-webkit-scrollbar {
    display: none;
}

/* Scroll Arrows */
.vop-scroll-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #333;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vop-scroll-arrow:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.vop-scroll-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.vop-scroll-prev {
    left: 0;
}

.vop-scroll-next {
    right: 0;
}

/* ==========================================================================
   Plan Cards
   ========================================================================== */

.vop-plan-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    padding: 24px;
    scroll-snap-align: start;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 280px;
}

.vop-plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    border-color: #20d6b4;
}

.vop-plan-card.vop-plan-popular {
    border-color: #20d6b4;
    box-shadow: 0 8px 24px rgba(32, 214, 180, 0.2);
}

/* Price Difference Badge */
.vop-price-diff-badge {
    position: absolute;
    top: -10px;
    right: 16px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
}

.vop-price-diff-badge.vop-upgrade {
    background: linear-gradient(135deg, #3ebd60 0%, #28a745 100%);
    color: #fff;
}

.vop-price-diff-badge.vop-downgrade {
    background: linear-gradient(135deg, #ff8e53 0%, #ff6b6b 100%);
    color: #fff;
}

/* Popular Badge */
.vop-popular-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffd93d 100%);
    color: #fff;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

/* Plan Header */
.vop-plan-card-header {
    position: relative;
    margin-bottom: 16px;
}

.vop-plan-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 4px 0;
}

.vop-plan-tier {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 8px;
}

/* Speed Info */
.vop-plan-speeds {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 16px;
}

.vop-plan-speed-item {
    text-align: center;
}

.vop-plan-speed-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.vop-plan-speed-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.vop-plan-speed-unit {
    font-size: 0.75rem;
    color: #666;
}

/* Pricing */
.vop-plan-pricing {
    text-align: center;
    margin-bottom: 16px;
}

.vop-plan-price {
    font-size: 2rem;
    font-weight: 700;
    color: #1a1a2e;
}

.vop-plan-price-period {
    font-size: 0.9rem;
    color: #666;
    font-weight: 400;
}

/* Select Button */
.vop-select-plan-btn {
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 50%, #ffd93d 100%);
    color: #fff;
    margin-top: auto;
}

.vop-select-plan-btn:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 16px rgba(255, 107, 107, 0.4);
}

.vop-select-plan-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ==========================================================================
   Loading States
   ========================================================================== */

.vop-plans-loading {
    display: contents;
}

.vop-plan-card-skeleton {
    background: #f5f5f5;
    border-radius: 16px;
    height: 320px;
    animation: vop-pulse 1.5s ease-in-out infinite;
}

@keyframes vop-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.vop-current-plan-loading .vop-loading-placeholder {
    display: inline-block;
    height: 1.5em;
    width: 200px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    animation: vop-pulse 1.5s ease-in-out infinite;
}

/* ==========================================================================
   Messages
   ========================================================================== */

.vop-no-plans-message,
.vop-pending-switch-message,
.vop-error-message {
    text-align: center;
    padding: 32px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-top: 24px;
}

.vop-pending-switch-message {
    background: #fff3cd;
    border: 1px solid #ffc107;
}

.vop-error-message {
    background: #f8d7da;
    border: 1px solid #dc3545;
    color: #721c24;
}

.vop-info-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    color: #856404;
}

/* ==========================================================================
   Switch Confirmation Modal
   ========================================================================== */

.vop-switch-comparison {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
}

.vop-switch-from,
.vop-switch-to {
    flex: 1;
    text-align: center;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 12px;
}

.vop-switch-label {
    font-size: 0.75rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.vop-switch-plan-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a1a2e;
    margin-bottom: 4px;
}

.vop-switch-plan-price {
    font-size: 1rem;
    color: #666;
}

.vop-switch-arrow {
    color: #20d6b4;
}

.vop-switch-arrow .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
}

.vop-price-impact {
    text-align: center;
    padding: 16px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-bottom: 24px;
}

.vop-price-impact.vop-downgrade {
    background: #fff3e0;
}

.vop-price-impact-label {
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 4px;
}

.vop-price-impact-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2e7d32;
}

.vop-price-impact.vop-downgrade .vop-price-impact-value {
    color: #e65100;
}

.vop-switch-notice {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: #e3f2fd;
    border-radius: 8px;
}

.vop-switch-notice .dashicons {
    color: #1976d2;
    flex-shrink: 0;
}

.vop-switch-notice p {
    margin: 0;
    font-size: 0.9rem;
    color: #1565c0;
    line-height: 1.5;
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

@media (max-width: 1200px) {
    .vop-plans-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .vop-plans-container {
        padding: 0;
    }

    .vop-plans-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 4px;
    }

    .vop-plan-card {
        min-width: unset;
    }

    .vop-scroll-arrow {
        display: none;
    }

    .vop-current-plan-card {
        padding: 20px;
    }

    .vop-current-plan-name {
        font-size: 1.25rem;
    }

    .vop-current-plan-speeds {
        flex-wrap: wrap;
        gap: 12px;
    }

    .vop-switch-comparison {
        flex-direction: column;
    }

    .vop-switch-arrow {
        transform: rotate(90deg);
    }

    .vop-switch-from,
    .vop-switch-to {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .vop-plan-switcher .vop-section-header h3 {
        font-size: 1.25rem;
    }

    .vop-billing-toggle {
        max-width: 100%;
    }

    .vop-billing-btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Mobile modal - bottom sheet style */
    #vop-switch-modal .vop-modal-content {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        border-radius: 16px 16px 0 0;
        max-height: 90vh;
    }

    .vop-price-impact-value {
        font-size: 1.25rem;
    }
}

/* Touch-friendly targets (44px minimum) */
@media (pointer: coarse) {
    .vop-billing-btn {
        min-height: 44px;
    }

    .vop-select-plan-btn {
        min-height: 48px;
    }

    .vop-scroll-arrow {
        width: 44px;
        height: 44px;
    }

    .vop-plan-card {
        cursor: pointer;
    }
}
