@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --header-bg: #0f172a;
    --header-text: #ffffff;
    --footer-bg: #0f172a;
    --footer-text: #94a3b8;
    --font-sans: 'Be Vietnam Pro', sans-serif;
    --glow-color: rgba(37, 99, 235, 0.15);
    --db-bg: linear-gradient(135deg, #fff1f2 0%, #ffe4e6 100%);
    --db-border: #f43f5e;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 16px;
    --shadow: 0 4px 20px -2px rgba(15, 23, 42, 0.06), 0 2px 8px -1px rgba(15, 23, 42, 0.04);
}

/* Light Theme 1: light-blue */
body[data-theme="light-blue"] {
    --bg-main: #f1f5f9;
    --bg-card: #ffffff;
    --border-color: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent: #3b82f6;
    --accent-hover: #1d4ed8;
    --header-bg: #1d4ed8;
    --header-text: #ffffff;
    --glow-color: rgba(59, 130, 246, 0.2);
    --db-bg: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    --db-border: #ef4444;
}

/* Light Theme 2: light-green */
body[data-theme="light-green"] {
    --bg-main: #f0fdf4;
    --bg-card: #ffffff;
    --border-color: #dcfce7;
    --text-primary: #064e3b;
    --text-secondary: #166534;
    --accent: #10b981;
    --accent-hover: #059669;
    --header-bg: #065f46;
    --header-text: #ffffff;
    --glow-color: rgba(16, 185, 129, 0.2);
    --db-bg: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    --db-border: #f59e0b;
}

/* Light Theme 3: light-orange */
body[data-theme="light-orange"] {
    --bg-main: #fff7ed;
    --bg-card: #ffffff;
    --border-color: #ffedd5;
    --text-primary: #431407;
    --text-secondary: #9a3412;
    --accent: #f97316;
    --accent-hover: #ea580c;
    --header-bg: #9a3412;
    --header-text: #ffffff;
    --glow-color: rgba(249, 115, 22, 0.2);
    --db-bg: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    --db-border: #e53e3e;
}

/* Dark Theme 1: dark-cyan */
body[data-theme="dark-cyan"] {
    --bg-main: #0b0f19;
    --bg-card: #151f32;
    --border-color: rgba(255, 255, 255, 0.06);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent: #06b6d4;
    --accent-hover: #0891b2;
    --header-bg: #0e1726;
    --header-text: #f8fafc;
    --footer-bg: #070b12;
    --glow-color: rgba(6, 182, 212, 0.25);
    --db-bg: linear-gradient(135deg, #162a3a 0%, #112233 100%);
    --db-border: #06b6d4;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* Dark Theme 2: dark-red */
body[data-theme="dark-red"] {
    --bg-main: #0a0a0c;
    --bg-card: #18181c;
    --border-color: rgba(255, 255, 255, 0.05);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --accent: #f43f5e;
    --accent-hover: #e11d48;
    --header-bg: #111115;
    --header-text: #f3f4f6;
    --footer-bg: #050507;
    --glow-color: rgba(244, 63, 94, 0.25);
    --db-bg: linear-gradient(135deg, #2c161a 0%, #1f1012 100%);
    --db-border: #f43f5e;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

/* Dark Theme 3: dark-violet */
body[data-theme="dark-violet"] {
    --bg-main: #090714;
    --bg-card: #141026;
    --border-color: rgba(255, 255, 255, 0.05);
    --text-primary: #f3f4f6;
    --text-secondary: #a78bfa;
    --accent: #8b5cf6;
    --accent-hover: #7c3aed;
    --header-bg: #0f0a1d;
    --header-text: #f3f4f6;
    --footer-bg: #040308;
    --glow-color: rgba(139, 92, 246, 0.25);
    --db-bg: linear-gradient(135deg, #231b42 0%, #17112c 100%);
    --db-border: #8b5cf6;
    --shadow: 0 10px 30px -10px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-sans);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphic Sticky Header */
.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    font-size: 24px;
    font-weight: 800;
    color: var(--header-text);
    letter-spacing: -1px;
    background: linear-gradient(to right, var(--header-text) 60%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 12px;
}

.nav-menu a {
    color: var(--header-text);
    font-weight: 600;
    font-size: 14px;
    padding: 10px 16px;
    border-radius: 10px;
    opacity: 0.8;
    transition: var(--transition);
}

.nav-menu a:hover, .nav-menu li.active a {
    opacity: 1;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.nav-menu li.active a {
    background: var(--accent);
    color: #ffffff;
    box-shadow: 0 4px 12px var(--glow-color);
}

/* Two-Column Grid Layout */
.main-grid {
    display: grid;
    grid-template-columns: 8fr 4fr;
    gap: 30px;
    align-items: start;
}

/* Cards */
.card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 28px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.08);
}

/* Tables styling */
.table-container {
    overflow-x: auto;
    margin-bottom: 24px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.kq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

.kq-table th, .kq-table td {
    padding: 12px 16px;
    text-align: center;
    border: 1px solid var(--border-color);
}

.kq-table th {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kq-table td.prize-name {
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--bg-main);
    width: 130px;
    text-align: left;
}

.kq-table td.numbers {
    background-color: var(--bg-card);
    text-align: center;
    padding: 10px 16px;
}

/* Row Special styling (Matching kqxs.uno) */
.kq-table tr.db-row {
    background-color: #fff1f2 !important; /* Soft rose background for the whole DB row */
}
body[data-theme^="dark"] .kq-table tr.db-row {
    background-color: #2c161a !important; /* Dark red background for DB row in dark theme */
}

.kq-table tr.db-row td.prize-name {
    color: #e11d48 !important; /* Rose-600 color for Đặc Biệt label */
    font-weight: 800;
}
body[data-theme^="dark"] .kq-table tr.db-row td.prize-name {
    color: #f43f5e !important;
}

/* Lotto Head/Tail Table */
.loto-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
    border-top: 1px dashed var(--border-color);
    padding-top: 24px;
}

.loto-card {
    background: rgba(0, 0, 0, 0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px;
}

.loto-card h4 {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 12px;
    text-align: center;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.loto-table {
    width: 100%;
    border-collapse: collapse;
}

.loto-table th, .loto-table td {
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    font-size: 13px;
}

.loto-table th {
    background: rgba(0,0,0,0.03);
    font-weight: 700;
}

.loto-table td.head-digit {
    font-weight: 800;
    color: var(--accent);
    text-align: center;
    width: 50px;
    background: rgba(0,0,0,0.01);
}

.loto-table td.tail-digits {
    font-weight: 600;
    letter-spacing: 1px;
}

.loto-table span.special-digit {
    color: var(--danger);
    font-weight: 800;
    background: rgba(239, 68, 68, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

/* 3D Radial Gradient Vietlott Balls */
.vietlott-ball-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 16px;
}

.ball {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.25), 
                inset -6px -6px 12px rgba(0, 0, 0, 0.4), 
                inset 6px 6px 12px rgba(255, 255, 255, 0.4);
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.8);
    position: relative;
    transition: var(--transition);
}

.ball:hover {
    transform: scale(1.1) rotate(5deg);
}

.ball-main {
    background: radial-gradient(circle at 30% 30%, #ff6b6b 0%, #ee0a0a 60%, #990000 100%);
}

.ball-bonus {
    background: radial-gradient(circle at 30% 30%, #fcd34d 0%, #d97706 60%, #78350f 100%);
}

/* Compact Vietlott Balls for Sidebar */
.vietlott-ball-container-compact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.ball-compact {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12.5px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25), 
                inset -3px -3px 6px rgba(0, 0, 0, 0.4), 
                inset 3px 3px 6px rgba(255, 255, 255, 0.4);
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
    position: relative;
    transition: var(--transition);
}

.ball-compact:hover {
    transform: scale(1.1) rotate(5deg);
}

/* Synchronized Card Header & Section Title Classes */
.card-header {
    background: linear-gradient(135deg, var(--header-bg) 0%, var(--accent) 100%);
    color: var(--header-text);
    padding: 14px 20px;
    font-weight: 700;
    font-size: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.card-header .card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--header-text);
}

.card-header .card-subtitle {
    font-size: 13.5px;
    font-weight: 500;
    opacity: 0.95;
    color: var(--header-text);
}

/* Schedule Sidebar card */
.sidebar-section-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 8px;
}

.sched-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 13.5px;
}

.sched-item:last-child {
    border-bottom: none;
}

.sched-day {
    font-weight: 600;
    color: var(--text-secondary);
}

.sched-province {
    font-weight: 700;
    color: var(--text-primary);
    text-align: right;
}

/* Articles and grid list */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.article-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.1);
}

/* Form inputs & General Admin panel */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--glow-color);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 700;
    border-radius: 10px;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
}

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
    box-shadow: 0 4px 15px var(--glow-color);
}

.btn-secondary {
    background-color: #64748b;
    color: #ffffff;
}

.btn-secondary:hover {
    background-color: #475569;
}

/* Footer layout */
.site-footer {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 48px 0;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 35px !important;
        text-align: center;
    }
    .footer-logo {
        display: flex;
        justify-content: center;
    }
    .footer-col {
        align-items: center !important;
    }
}

@media (max-width: 992px) {
    .main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-container {
        flex-direction: row !important;
        height: 60px;
        justify-content: space-between;
        align-items: center;
        padding: 0 16px;
    }
    
    .site-header nav {
        display: none !important;
    }
    
    .loto-container {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

/* Loto Interactive Highlights & Controls */
.prize-nums-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 4px 0;
}

.prize-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #ffffff; /* Always clean white for light mode */
    border: 1px solid #cbd5e1; /* thin gray border */
    border-radius: 8px;
    padding: 7px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a; /* slate-900 */
    min-width: 70px;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

/* Adjust normal cards for dark themes */
body[data-theme^="dark"] .prize-num {
    background-color: #1e293b;
    border-color: #334155;
    color: #f8fafc;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
}

/* Standout Special Prize Card styling (Matching kqxs.uno) */
.db-row .prize-num {
    background-color: #ffe4e6 !important; /* soft rose-100 bg */
    border-color: #fecdd3 !important; /* rose-200 border */
    color: #e11d48 !important; /* rose-600 color */
    font-size: 20px;
    font-weight: 800;
    padding: 10px 24px;
    min-width: 100px;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.08);
}
body[data-theme^="dark"] .db-row .prize-num {
    background-color: #4c1d24 !important;
    border-color: #9f1239 !important;
    color: #fda4af !important;
    box-shadow: 0 4px 10px rgba(225, 29, 72, 0.2);
}

.prize-num.digit-highlight {
    background-color: #fef08a !important; /* bright yellow-200 bg */
    color: #b45309 !important; /* amber-700 text */
    border-color: #facc15 !important;
    font-weight: 800;
    transform: scale(1.05);
    box-shadow: 0 0 12px rgba(250, 204, 21, 0.6);
}

/* Adjust highlight style for dark themes */
body[data-theme^="dark"] .prize-num.digit-highlight {
    background-color: #ca8a04 !important; /* gold-600 bg */
    color: #ffffff !important;
    border-color: #eab308 !important;
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.5);
}

.digit-btn {
    transition: var(--transition);
}

.digit-btn:hover {
    background: rgba(0,0,0,0.1) !important;
    border-color: var(--accent) !important;
}

.digit-btn.active {
    background-color: var(--accent) !important;
    color: white !important;
    border-color: var(--accent) !important;
    box-shadow: 0 0 10px var(--glow-color);
}

/* Navigation Dropdown Menu Styling */
.nav-menu li {
    position: relative;
}

.nav-menu li .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow);
    min-width: 180px;
    list-style: none;
    padding: 8px 0;
    margin: 8px 0 0 0;
    z-index: 1001;
}

.nav-menu li:hover .dropdown-menu {
    display: block;
}

.nav-menu li .dropdown-menu li {
    width: 100%;
}

.nav-menu li .dropdown-menu a {
    color: var(--text-primary);
    padding: 10px 18px;
    display: block;
    border-radius: 0;
    font-weight: 500;
    opacity: 0.9;
    text-align: left;
    transition: var(--transition);
}

.nav-menu li .dropdown-menu a:hover {
    background-color: rgba(0, 0, 0, 0.04);
    color: var(--accent);
    opacity: 1;
}

/* Adjust active state in dropdown */
.nav-menu li .dropdown-menu li.active a {
    background-color: var(--accent);
    color: #ffffff !important;
    opacity: 1;
}

/* Caret indicator icon */
.nav-menu li.has-dropdown > a::after {
    content: " \f107";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    font-size: 11px;
    margin-left: 5px;
    opacity: 0.8;
}

/* Homepage Headline and Vietlott Summary Styles */
.homepage-headline {
    text-align: center;
    margin-bottom: 25px;
}

.homepage-headline h1 {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(to right, var(--text-primary), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.homepage-headline p {
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.vietlott-summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .vietlott-summary-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile Actions (Top Right Header Buttons) */
.mobile-actions {
    display: none;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .mobile-actions {
        display: flex;
    }
}

.mobile-action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    color: var(--header-text);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.mobile-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Mobile Menu Drawer Styles */
.mobile-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5); /* Semi-transparent slate-900 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1040;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-backdrop.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-drawer {
    position: fixed;
    top: 0;
    left: 0;
    width: 320px;
    max-width: 85vw;
    height: 100vh;
    background-color: var(--bg-card);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.mobile-menu-drawer.open {
    transform: translateX(0);
}

/* Header inside drawer */
.drawer-header {
    position: relative;
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background-color: var(--bg-card);
}

.drawer-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.drawer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    text-decoration: none;
}

.drawer-logo img {
    max-height: 42px;
    width: auto;
    display: block;
}

.drawer-logo span {
    font-size: 22px;
    font-weight: 800;
    color: var(--accent);
}

.drawer-tagline {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
    margin: 0;
    line-height: 1.4;
}

.drawer-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.drawer-close-btn:hover {
    color: var(--danger);
    opacity: 1;
}

/* Navigation Menu */
.drawer-nav {
    flex-grow: 1;
    overflow-y: auto;
    padding: 10px 0 30px;
}

.drawer-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.drawer-item {
    border-bottom: 1px solid var(--border-color);
}

/* Common style for links and trigger rows */
.drawer-link, .drawer-dropdown-trigger {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    transition: var(--transition);
    width: 100%;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
}

.drawer-link-part {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.drawer-link:hover, .drawer-dropdown-trigger:hover {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--accent);
}

body[data-theme^="dark"] .drawer-link:hover, 
body[data-theme^="dark"] .drawer-dropdown-trigger:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.drawer-icon-wrap {
    margin-right: 12px;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    text-align: center;
}

.drawer-label {
    flex-grow: 1;
}

.drawer-caret {
    font-size: 12px;
    color: var(--text-secondary);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Rotating caret on open */
.drawer-item.open .drawer-caret {
    transform: rotate(180deg);
}

/* Dropdown Sub-menu */
.drawer-dropdown-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    background-color: var(--bg-main);
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.drawer-dropdown-menu li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

body[data-theme^="dark"] .drawer-dropdown-menu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.drawer-dropdown-menu li:last-child {
    border-bottom: none;
}

.drawer-dropdown-menu a {
    display: block;
    padding: 12px 20px 12px 56px;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.drawer-dropdown-menu a:hover {
    color: var(--accent);
    background-color: rgba(0, 0, 0, 0.04);
}

body[data-theme^="dark"] .drawer-dropdown-menu a:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Highlight active item */
.drawer-item.active > .drawer-link,
.drawer-item.active > .drawer-dropdown-trigger {
    color: var(--accent);
    background-color: var(--glow-color);
}

/* Card Body class */
.card-body {
    padding: 24px;
}

/* Loto Controls Panel */
.loto-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    background: rgba(0,0,0,0.01);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
}

body[data-theme^="dark"] .loto-controls {
    background: rgba(255, 255, 255, 0.02);
}

.loto-views-toggle {
    display: flex;
    align-items: center;
    gap: 15px;
    border-right: 1px solid var(--border-color);
    padding-right: 15px;
    margin-right: 5px;
}

.loto-digits-filter {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    /* Reduce body container spacing */
    .container {
        padding: 0 12px !important;
    }
    
    main.container {
        padding-top: 15px !important;
        padding-bottom: 20px !important;
    }

    .card {
        margin-bottom: 20px !important;
    }

    .card-body {
        padding: 12px !important;
    }

    /* Table optimization for mobile */
    .table-container {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin-bottom: 16px !important;
        border-radius: 8px !important;
    }

    .kq-table {
        min-width: 480px; /* Force minimum width to prevent columns squeezing too much */
    }

    .kq-table th, .kq-table td {
        padding: 8px 6px !important;
        font-size: 13px !important;
    }

    .kq-table td.prize-name {
        width: 75px !important;
        min-width: 75px !important;
        padding-left: 8px !important;
        font-size: 12.5px !important;
    }

    .kq-table th[style*="width: 150px"],
    .kq-table th[style*="width: 130px"] {
        width: 75px !important;
        min-width: 75px !important;
    }

    /* Prize numbers cards on mobile */
    .prize-nums-container {
        gap: 6px !important;
    }

    .prize-num {
        padding: 4px 8px !important;
        font-size: 13.5px !important;
        min-width: 50px !important;
        border-radius: 6px !important;
    }

    .db-row .prize-num {
        font-size: 16px !important;
        padding: 6px 12px !important;
        min-width: 75px !important;
    }

    /* Loto Controls responsive layout */
    .loto-controls {
        padding: 10px 12px !important;
        gap: 8px !important;
        margin-bottom: 15px !important;
    }
    
    .loto-views-toggle {
        border-right: none !important;
        padding-right: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        justify-content: center !important;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 10px !important;
        margin-bottom: 5px !important;
        gap: 20px !important;
    }
    
    .loto-digits-filter {
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 4px !important;
        width: 100% !important;
    }
    
    .digit-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
}

/* Responsive Div-Based Grid (KQ Grid) */
.kq-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    background-color: var(--bg-card);
    overflow: hidden;
}

.kq-grid-header {
    display: flex;
    background-color: var(--bg-main);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
}

.kq-grid-body {
    display: flex;
    flex-direction: column;
}

.kq-grid-row {
    display: flex;
    border-bottom: 1px solid var(--border-color);
}

.kq-grid-row:last-child {
    border-bottom: none;
}

.kq-grid-cell {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex: 1; /* Distribute column space evenly */
    border-right: 1px solid var(--border-color);
    min-width: 0;
}

.kq-grid-cell:last-child {
    border-right: none;
}

.kq-grid-cell.label-cell {
    width: 130px;
    max-width: 130px;
    min-width: 130px;
    flex: 0 0 130px;
    font-weight: 700;
    color: var(--text-secondary);
    background-color: var(--bg-main);
    justify-content: flex-start;
}

.kq-grid-cell.header-cell {
    font-size: 15px;
    font-weight: 700;
}

.kq-grid-cell.numbers-cell {
    background-color: var(--bg-card);
}

/* Special row styling */
.kq-grid-row.db-row {
    background-color: #fff1f2 !important;
}

body[data-theme^="dark"] .kq-grid-row.db-row {
    background-color: #2c161a !important;
}

.kq-grid-row.db-row .label-cell {
    color: #e11d48 !important;
    font-weight: 800;
}

body[data-theme^="dark"] .kq-grid-row.db-row .label-cell {
    color: #f43f5e !important;
}

/* Layout constraints for grid items to prevent stretching */
.main-content {
    min-width: 0 !important;
    max-width: 100% !important;
    overflow: hidden !important;
}

.main-grid {
    min-width: 0 !important;
    width: 100% !important;
}

.card {
    max-width: 100% !important;
}

/* Mobile adjustments for the Grid */
@media (max-width: 768px) {
    .kq-grid {
        min-width: 480px; /* Force scrollbar when viewport is smaller */
    }

    .kq-grid-cell {
        padding: 8px 6px !important;
        font-size: 13px !important;
    }

    .kq-grid-cell.label-cell {
        width: 75px !important;
        max-width: 75px !important;
        min-width: 75px !important;
        flex: 0 0 75px !important;
        font-size: 12.5px !important;
        padding-left: 8px !important;
    }
}



