/* Premium Page Styles - XP/Candy Theme */

#checkout-modal #card-element {
    background: white;
}
#checkout-modal .card-label {
    color: #333;
}

.premium-window {
    width: 800px;
    max-width: 95vw;
    height: 80vh;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.premium-content {
    background: var(--xp-bg);
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.pricing-header {
    text-align: center;
    margin-bottom: 30px;
}

.pricing-header h2 {
    color: var(--xp-blue-dark);
    font-family: var(--font-header);
    margin-bottom: 5px;
}

.pricing-header p {
    font-size: 12px;
    color: var(--xp-text-color);
    opacity: 0.7;
}

/* Pricing Grid - Landscape Mode */
.pricing-grid {
    display: flex; /* Force landscape row */
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    align-items: flex-end; /* Align bottom so pop-up grows up */
    flex-wrap: nowrap; /* Prevent wrapping on desktop */
}

/* Responsive adjustments */
@media (max-width: 900px) {
    .pricing-grid {
        flex-wrap: wrap; /* Wrap on tablets */
    }
    .pricing-card {
        width: 45% !important;
    }
}

@media (max-width: 600px) {
    .pricing-card {
        width: 100% !important;
    }
}

.pricing-card {
    background: var(--xp-window-bg);
    border: 2px solid var(--xp-silver);
    border-radius: var(--radius-panel);
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s;
    color: var(--xp-text-color);
    width: 250px; /* Fixed width for cards */
    min-height: 400px;
}

.pricing-card:hover {
    transform: translateY(-5px);
}

.pricing-card.featured {
    border: 3px solid #FFD700;
    background: var(--xp-window-bg);
    transform: scale(1.1); /* More elevated */
    z-index: 10;
    box-shadow: 0 10px 20px rgba(0,0,0,0.2);
    min-height: 420px; /* Taller */
}

/* Override background for featured card in light mode to keep it distinct, 
   but respect dark mode via variable overrides if needed later. 
   For now, simple background is safer. */
body:not(.night-mode) .pricing-card.featured {
    background: #FFFFF0;
}

.pricing-card.featured:hover {
    transform: scale(1.1) translateY(-5px);
}

.pricing-badge {
    background: linear-gradient(180deg, #FFD700 0%, #FFA500 100%);
    color: #333;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
    position: absolute;
    top: -10px;
    border: 1px solid #B8860B;
}

.plan-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.plan-name {
    font-size: 18px;
    font-weight: bold;
    color: var(--xp-text-color);
    margin-bottom: 5px;
    font-family: var(--font-header);
}

.plan-price {
    font-size: 28px;
    font-weight: bold;
    color: var(--xp-blue-dark);
    margin-bottom: 15px;
}

.plan-price span {
    font-size: 12px;
    color: var(--xp-text-color);
    opacity: 0.6;
    font-weight: normal;
}

.feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
    width: 100%;
    text-align: left;
}

.feature-list li {
    padding: 6px 0;
    border-bottom: 1px solid var(--xp-silver);
    font-size: 12px;
    color: var(--xp-text-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.feature-list li::before {
    content: "✓";
    color: var(--xp-green);
    font-weight: bold;
}

.feature-list li.missing {
    color: var(--xp-text-color);
    opacity: 0.5;
}

.feature-list li.missing::before {
    content: "×";
    color: inherit;
}

.comparison-section {
    background: var(--xp-window-bg);
    border: 1px solid var(--xp-blue-select);
    padding: 15px;
    border-radius: 4px;
    margin-top: 40px;
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
    color: var(--xp-text-color);
}

.comparison-table th {
    text-align: left;
    padding: 8px;
    border-bottom: 2px solid var(--xp-silver);
    color: var(--xp-blue-dark);
}

.comparison-table td {
    padding: 8px;
    border-bottom: 1px solid var(--xp-silver);
}

.check { color: var(--xp-green); font-weight: bold; text-align: center; }
.cross { color: #FF6464; text-align: center; }
.center { text-align: center; }

/* Night Mode Specific Overrides */
body.night-mode .pricing-header h2,
body.night-mode .plan-price,
body.night-mode .comparison-table th,
body.night-mode .plan-name {
    color: #FFFFFF !important;
}

body.night-mode .feature-list li::before,
body.night-mode .check {
    color: #00FF00 !important; /* Neon Green */
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
}

body.night-mode .feature-list li.missing::before,
body.night-mode .cross {
    color: #FF0000 !important; /* Bright Red */
    text-shadow: 0 0 5px rgba(255, 0, 0, 0.5);
}

/* Inline Card Overrides for Night Mode */
body.night-mode .pricing-card-inline {
    background: #2f3640 !important;
    color: #FFFFFF !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

/* Card Titles (Free, Premium, etc) - Overriding inline color #0A246A */
body.night-mode .pricing-card-inline div[style*="color: #0A246A"] {
    color: #FFFFFF !important;
}

/* Comparison Table Container */
body.night-mode div[style*="background: white; border: 2px solid #D4D0C8"] {
    background: #2f3640 !important;
    border-color: #576574 !important;
}

/* Table Rows - Alternating colors */
body.night-mode table tr[style*="background: #f9f9f9"] {
    background: #353b48 !important;
    color: #FFFFFF !important;
}
body.night-mode table tr {
    color: #FFFFFF !important;
}

/* Table Cells Borders */
body.night-mode table td {
    border-color: #576574 !important;
}

/* Table Header Background */
body.night-mode table tr[style*="background: #0A246A"] {
    background: #192a56 !important;
}

/* === SHOP NIGHT MODE OVERRIDES === */

/* Section headers */
body.night-mode #tab-subscriptions h2[style*="color: #0A246A"],
body.night-mode #tab-coins h2[style*="color: #0A246A"],
body.night-mode #tab-packs h2[style*="color: #0A246A"] {
    color: #FFFFFF !important;
}

/* Subtitle/description text */
body.night-mode .tab-content p[style*="color: #595959"],
body.night-mode .tab-content div[style*="color: #595959"] {
    color: #ccc !important;
}

/* Pricing card list items */
body.night-mode .pricing-card-inline ul,
body.night-mode .pricing-card-inline li {
    color: #dcdde1 !important;
}
body.night-mode .pricing-card-inline div[style*="color: #595959"] {
    color: #aaa !important;
}
body.night-mode .pricing-card-inline span[style*="color: #595959"] {
    color: #aaa !important;
}

/* Cart sidebar */
body.night-mode #cart-sidebar {
    background: #2f3640 !important;
    border-color: #576574 !important;
}
body.night-mode #cart-sidebar div[style*="background: #ECE9D8"] {
    background: #353b48 !important;
}
body.night-mode #cart-items {
    color: #dcdde1 !important;
}
body.night-mode #cart-items div[style*="color: #767676"] {
    color: #888 !important;
}
body.night-mode #cart-items .cart-item div {
    color: #dcdde1 !important;
}
body.night-mode #cart-items .cart-item {
    border-color: #576574 !important;
}
body.night-mode #cart-total {
    color: #fff !important;
}

/* Decoration Packs / Country Packs */
body.night-mode #packs-grid > div {
    background: #2f3640 !important;
    color: #dcdde1 !important;
    border-color: #576574 !important;
}
body.night-mode #packs-grid div[style*="color: #555"],
body.night-mode #packs-grid div[style*="color: #595959"] {
    color: #bbb !important;
}
body.night-mode #pack-detail-desc {
    color: #ccc !important;
}

/* Shop tabs */
body.night-mode .shop-tab {
    background: #353b48;
    color: #dcdde1;
    border-color: #576574;
}
body.night-mode .shop-tab.active {
    background: #2f3640;
    color: #fff;
    border-bottom-color: #2f3640;
}
body.night-mode .shop-tab:hover:not(.active) {
    background: #414b5a;
}
body.night-mode #tab-accessories h2 {
    color: #7eb8ff !important;
}
body.night-mode #tab-accessories p,
body.night-mode #accessories-grid div[style*="color: #595959"] {
    color: #aaa !important;
}

/* Menu bar and status bar */
body.night-mode .premium-window div[style*="background: #ECE9D8"] {
    background: #353b48 !important;
    border-color: #576574 !important;
    color: #dcdde1 !important;
}
body.night-mode .premium-window div[style*="color: #555"] {
    color: #aaa !important;
}
body.night-mode .premium-window span[style*="color: #595959"] {
    color: #aaa !important;
}
body.night-mode .premium-window span[style*="color: #595959"] {
    color: #aaa !important;
}

/* Checkout modal dark mode */
body.night-mode #checkout-modal .xp-window-content div[style*="background: #f5f5f5"] {
    background: #353b48 !important;
    border-color: #576574 !important;
}
body.night-mode #checkout-modal div[style*="color: #0A246A"] {
    color: #7eb8ff !important;
}
body.night-mode #checkout-modal div[style*="color: #595959"] {
    color: #aaa !important;
}
body.night-mode #checkout-modal .card-label {
    color: #dcdde1 !important;
}
body.night-mode #checkout-modal #card-element {
    background: #2f3640 !important;
    border-color: #576574 !important;
}
body.night-mode #checkout-modal #checkout-success {
    background: #1a3a2a !important;
    border-color: #2e7d32 !important;
}
body.night-mode #checkout-modal #checkout-success div[style*="color: #333"] {
    color: #dcdde1 !important;
}
body.night-mode #checkout-modal div[style*="background: #ECE9D8"] {
    background: #353b48 !important;
    color: #aaa !important;
}

/* Pack card titles (inline color: #0A246A) in dark mode */
body.night-mode #packs-grid div[style*="color: #0A246A"],
body.night-mode #suggested-packs-grid div[style*="color: #0A246A"] {
    color: #FFFFFF !important;
}

/* Pack card coin prices and item prices (inline color: #333) */
body.night-mode #packs-grid div[style*="color: #333"],
body.night-mode #packs-grid span[style*="color: #333"],
body.night-mode #pack-detail-modal div[style*="color: #333"] {
    color: #dcdde1 !important;
}

/* Pack card owned count text */
body.night-mode #packs-grid div[style*="color: #555"],
body.night-mode #packs-grid span[style*="color: #555"] {
    color: #bbb !important;
}

/* Coin balance display in coins tab */
body.night-mode #coins-balance-display {
    color: #FFD700 !important;
}

/* User coins display in menu bar */
body.night-mode #user-coins-display {
    color: #FFD700 !important;
}

/* Pack item backgrounds in expanded view (dark mode) */
body.night-mode #packs-grid div[style*="background: #fafafa"] {
    background: #353b48 !important;
}

/* Pack detail modal dark mode */
body.night-mode #pack-detail-modal .xp-window-content {
    background: #2f3640 !important;
    color: #dcdde1 !important;
}
body.night-mode #pack-detail-modal div[style*="color: #555"] {
    color: #bbb !important;
}
body.night-mode #pack-detail-modal div[style*="background: #fafafa"] {
    background: #353b48 !important;
}

/* === RESPONSIVE PRICING GRID === */

/* Default Desktop Layout */
.pricing-grid-container {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap; /* Allow wrapping on smaller desktop/tablet */
}

/* Mobile Layout - 2x2 Grid */
@media screen and (max-width: 768px) {
    .premium-window {
        width: 100% !important;
        max-width: 100% !important;
        /* Keep border-radius from desktop XP window style */
    }

    .pricing-grid-container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 10px;
        padding: 5px;
    }

    .pricing-card-inline {
        width: 100% !important;
        min-width: 0;
        padding: 10px !important;
    }

    .pricing-card-inline div[style*="font-size: 28px"] { font-size: 24px !important; }
    .pricing-card-inline div[style*="font-size: 20px"] { font-size: 16px !important; }
    .pricing-card-inline ul { padding-left: 10px !important; }
    .pricing-card-inline li { font-size: 10px !important; }
}
