/* CSS Design System for VeSo365 Demo - Modern Light Mode */

:root {
    --bg-primary: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #f1f5f9;
    --primary: #ef4444; /* Vietlott Red */
    --primary-hover: #dc2626;
    
    /* Game Colors */
    --color-keno: #f97316; /* Orange */
    --color-power: #eab308; /* Yellow/Gold */
    --color-mega: #ef4444; /* Red */
    --color-lotto: #22c55e; /* Green */
    --color-max3d: #ec4899; /* Pink */
    --color-dientoan: #3b82f6; /* Blue */
    
    /* Layout Variables */
    --border-radius-lg: 20px;
    --border-radius-md: 14px;
    --border-radius-sm: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.03), 0 4px 6px -4px rgba(0, 0, 0, 0.03);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: #581c1c;
    color: var(--text-main);
    font-size: 15px;
    line-height: 1.5;
    padding-bottom: 78px; /* Spacer for mobile nav */
    overflow-x: hidden;
}

h1, h2, h3, h4, .brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

/* App Layout Container */
.app-container {
    max-width: 500px; /* Mobile mockup view */
    margin: 0 auto;
    background: radial-gradient(circle at 50% 20%, #ef4444 0%, #991b1b 60%, #581c1c 100%);
    min-height: 100vh;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
    border-bottom: 1.5px solid #fbbf24; /* Premium Gold border */
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

.brand-name {
    font-size: 1.3rem;
    color: #ffffff;
    letter-spacing: -0.5px;
    text-shadow: 0 0 8px rgba(253, 224, 71, 0.6); /* Gold title glow */
}

.wallet-badge {
    background: linear-gradient(135deg, #fef08a 0%, #fde047 100%);
    border: 1px solid #facc15;
    color: #713f12;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 6px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.wallet-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(250, 204, 21, 0.2);
}

/* Banner Carousel */
.promo-banner {
    padding: 12px 16px 4px 16px;
    position: relative;
}

.carousel-slide {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    border-radius: var(--border-radius-lg);
    padding: 10px 14px;
    position: relative;
    overflow: hidden;
    min-height: 95px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
}

.carousel-content {
    max-width: 60%;
    z-index: 2;
}

.carousel-tag {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    display: inline-block;
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

.carousel-title {
    font-size: 1.05rem;
    color: #991b1b;
    line-height: 1.2;
    margin-bottom: 4px;
}

.carousel-desc {
    font-size: 0.7rem;
    color: #7f1d1d;
    opacity: 0.85;
}

.carousel-img {
    width: 75px;
    height: 75px;
    object-fit: contain;
    z-index: 2;
    animation: bounce 4s infinite ease-in-out;
}

.carousel-bg-glow {
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 160px;
    height: 160px;
    background: radial-gradient(circle, rgba(239,68,68,0.2) 0%, transparent 70%);
    z-index: 1;
}

/* Sticky Category Navigation */
.category-nav {
    background: #991b1b;
    display: flex;
    justify-content: space-around;
    padding: 6px 12px;
    border-bottom: 2px solid #fbbf24; /* Stronger Gold border */
    position: sticky;
    top: 62px;
    z-index: 99;
}

.category-tab {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent;
}

.category-tab.active {
    color: #991b1b;
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    box-shadow: 0 0 10px rgba(251, 191, 36, 0.4);
}

/* Main Content Area */
.app-content {
    flex: 1;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.section-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.section-title {
    font-size: 1.15rem;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Vietlott Cards Grid */
.vietlott-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

/* Clean Card Component */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 12px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 105px;
}

.game-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(251, 191, 36, 0.15);
    border-color: #fbbf24;
}

@keyframes pulse-orange {
    0% {
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
        transform: scale(1.02);
    }
    50% {
        box-shadow: 0 0 24px rgba(249, 115, 22, 0.9);
        transform: scale(1.04);
        border-color: #ea580c;
    }
    100% {
        box-shadow: 0 0 8px rgba(249, 115, 22, 0.4);
        transform: scale(1.02);
    }
}

.game-card.featured-card {
    border: 2px solid #f97316; /* Stronger orange border */
    background: linear-gradient(135deg, #ffffff 0%, #ffedd5 60%, #fed7aa 100%); /* Stronger orange gradient tint */
    animation: pulse-orange 2s infinite ease-in-out;
    position: relative;
    z-index: 10;
}


.card-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.card-timer {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--primary);
}

.card-badge {
    font-size: 0.58rem;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    text-transform: uppercase;
}

.badge-green {
    background-color: #dcfce7;
    color: #15803d;
}

.badge-orange {
    background-color: #ffedd5;
    color: #c2410c;
}

.badge-blue {
    background-color: #dbeafe;
    color: #1d4ed8;
}

.badge-purple {
    background-color: #f3e8ff;
    color: #6b21a8;
}

.badge-red {
    background-color: #fee2e2;
    color: #b91c1c;
}

.game-name {
    font-size: 1.15rem;
    font-weight: 900;
    font-family: 'Outfit', sans-serif;
    line-height: 1.1;
    margin-bottom: 2px;
}

.game-name.text-keno { color: var(--color-keno); }
.game-name.text-power { color: var(--color-power); }
.game-name.text-mega { color: var(--color-mega); }
.game-name.text-max3d { color: var(--color-max3d); }
.game-name.text-dientoan { color: var(--color-dientoan); }

.jackpot-lbl {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-bottom: 1px;
}

.jackpot-val {
    font-size: 0.9rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.jackpot-val.highlight {
    color: var(--primary);
}

.card-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Full Width Lotto Card */
.lotto-card-row {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.lotto-card-row:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: rgba(34, 197, 94, 0.2);
}

.lotto-card-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.lotto-title-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.lotto-name {
    font-size: 1.15rem;
    font-weight: 900;
    color: var(--color-lotto);
}

.lotto-card-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.lotto-countdown {
    font-size: 0.8rem;
    font-weight: 700;
    color: #eab308;
    background: #fef9c3;
    padding: 2px 8px;
    border-radius: 12px;
    margin-top: 4px;
}

.lotto-card-right {
    position: relative;
}

.lucky-bag-img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    animation: float 3s infinite ease-in-out;
}

/* Digital Lottery (Điện toán) Grid */
.dientoan-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.dientoan-card {
    min-height: 100px;
}

.dientoan-lbl {
    font-size: 1.05rem;
    font-weight: 800;
    font-style: italic;
    font-family: 'Outfit', sans-serif;
}

.dientoan-desc-row {
    font-size: 0.72rem;
    font-weight: 700;
    color: #3b82f6;
    margin-bottom: 2px;
}

/* XSKT Table Layout */
.xskt-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.xskt-table {
    display: flex;
    width: 100%;
}

.xskt-col-day {
    width: 60px;
    background: #f8fafc;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
}

.xskt-day-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    width: 100%;
    padding: 8px 4px;
    transition: var(--transition);
}

.xskt-day-btn.active {
    background: #fee2e2;
    border-left: 3px solid var(--primary);
}

.xskt-day-btn .day-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.xskt-day-btn.active .day-title {
    color: var(--primary);
}

.xskt-day-btn .day-date {
    font-size: 0.75rem;
    font-weight: 800;
    margin-top: 2px;
}

.xskt-col-regions {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.xskt-region-row {
    display: flex;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border-color);
    align-items: flex-start;
}

.xskt-region-row:last-child {
    border-bottom: none;
}

.region-header {
    font-size: 0.7rem;
    font-weight: 800;
    color: var(--text-muted);
    width: 65px;
    text-transform: uppercase;
    padding-top: 6px;
}

.province-list {
    flex: 1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.province-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    width: 46px;
    transition: var(--transition);
}

.province-item:hover {
    transform: translateY(-2px);
}

.province-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
    margin-bottom: 4px;
    background: transparent;
}

.logo-svg {
    width: 100%;
    height: 100%;
    display: block;
}

.province-name {
    font-size: 0.72rem;
    font-weight: 700;
    color: #64748b;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
}

/* Sticky Bottom Mobile Navigation */
.mobile-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: #991b1b;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 6px 8px;
    z-index: 100;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.15);
    height: 64px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.65rem;
    font-weight: 700;
    gap: 3px;
    background: none;
    border: none;
    cursor: pointer;
    height: 100%;
    border-radius: 12px;
    transition: var(--transition);
    flex: 1;
    margin: 0 4px;
}

.nav-item.active {
    color: #7f1d1d;
    background: linear-gradient(135deg, #ffffff 0%, #fef3c7 100%);
    border: 1px solid #fbbf24;
    box-shadow: 0 4px 10px rgba(251, 191, 36, 0.3);
}

.nav-item svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Modals & Overlays */
.overlay {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    height: 100%;
    background: rgba(15, 23, 42, 0.5);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.drawer {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    padding: 24px 16px;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.overlay.active .drawer {
    transform: translateY(0);
}

.drawer-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.drawer-title {
    font-size: 1.2rem;
    color: var(--text-main);
}

.btn-close {
    border: none;
    background: #f1f5f9;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-muted);
}

/* Number Grid Selection */
.number-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    padding: 8px 0;
}

.number-ball {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: #f8fafc;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.number-ball:hover {
    border-color: var(--primary);
    background: #fef2f2;
}

.number-ball.selected {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
}

.quick-pick-row {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.btn-pill {
    border: 1px solid var(--border-color);
    background: #f8fafc;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.btn-pill:hover, .btn-pill.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Cart Summary & Actions */
.cart-summary {
    background: #f8fafc;
    border-radius: var(--border-radius-md);
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.cart-total-val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
}

.btn-checkout {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
    transition: var(--transition);
}

.btn-checkout:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.35);
}

/* Toast Notification */
.toast-msg {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #1e293b;
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 700;
    z-index: 2000;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 8px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.toast-msg.active {
    opacity: 1;
}

/* Animations */
@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-6px) rotate(3deg); }
}

@keyframes pulse {
    0% { transform: scale(0.95); opacity: 0.5; }
    50% { transform: scale(1); opacity: 1; }
    100% { transform: scale(0.95); opacity: 0.5; }
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--primary);
    display: inline-block;
    animation: pulse 1.5s infinite;
}

/* Quick utility styles */
.text-gold { color: #eab308; }
.mr-2 { margin-right: 8px; }
.bold { font-weight: 700; }
.align-center { display: flex; align-items: center; }
.gap-4 { gap: 4px; }
