/* ============================================
   assets/css/mainindex.css
   Main Index Page Styles
   ============================================ */

/* ============================================
   LOCAL FONTS - Merriweather
   ============================================ */
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-Italic-VariableFont_opsz,wdth,wght.ttf') format('truetype');
    font-weight: 400;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-LightItalic.ttf') format('truetype');
    font-weight: 300;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Merriweather';
    src: url('../fonts/Merriweather-BlackItalic.ttf') format('truetype');
    font-weight: 900;
    font-style: italic;
    font-display: swap;
}

/* ============================================
   GLOBAL STYLES
   ============================================ */
:root {
    --gold: #ffd700;
    --gold-dark: #b8860b;
    --bg-dark: #0a0a0a;
    --card-bg: rgba(0, 0, 0, 0.85);
}

html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-dark);
    background-image: url('../images/bg-2.png');
    background-size: 100% 100%;
    background-position: center center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    font-family: 'Merriweather', serif;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Black overlay on parent BG */
.main-container {
    max-width: 1800px;
    margin: 0 auto;
    padding: 15px;
    flex: 1;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 12px;
    backdrop-filter: blur(2px);
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

/* ============================================
   HEADER SECTION
   ============================================ */
.header-section {
    background: transparent;
    padding: 0;
    border-bottom: none;
}
.header-section .logo img {
    max-height: 110px;
    width: auto;
    object-fit: contain;
}

.header-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
}

.header-section .welcome-text {
    color: rgba(255,255,255,0.3);
    font-size: 13px;
    font-weight: 400;
}

/* ============================================
   MARQUEE SECTION
   ============================================ */
.marquee-section {
    background: transparent;
    padding: 0;
    border-bottom: none;
}

/* ============================================
   INFO BAR
   ============================================ */
.info-bar {
    background: transparent !important;
    padding: 15px 0;
    border-bottom: none !important;
}
.info-item {
    text-align: center;
}

.info-item .label {
    font-family: 'Merriweather', serif;
    font-size: 18px !important;
    color: #ffffff !important;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9) !important;
}

.info-item .value {
    font-family: 'Merriweather', serif;
    font-size: 17px !important;
    font-weight: 600;
    color: #ffffff !important;
    margin-top: 4px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.9) !important;
}

/* ============================================
   TABS
   ============================================ */
.tab-header {
    font-family: 'Merriweather', serif;
    display: inline-block;
    padding: 12px 30px;
    border-radius: 10px 10px 0 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 16px;
    border: none;
    transition: all 0.3s;
    min-width: 180px;
    text-align: center;
}
.tab-header.active {
    background: linear-gradient(135deg, #ffd700, #f0a500);
    color: #000;
}
.tab-header.inactive {
    background: rgba(67,79,146,0.8);
    color: #ffffff;
}
.tab-header.inactive:hover {
    background: rgba(67,79,146,1);
}
.tab-content {
    display: none;
    padding: 15px;
    background: rgba(0,0,0,0.6);
    border-radius: 0 10px 10px 10px;
    border: 1px solid rgba(255,215,0,0.1);
}
.tab-content.active {
    display: block;
}

/* ============================================
   SELECT DRAW TIME
   ============================================ */
#drawTimeSelect {
    font-family: 'Merriweather', serif;
    background: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(255, 215, 0, 0.3) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    width: 180px !important;
    display: inline-block !important;
    font-size: 13px !important;
    padding: 5px 10px !important;
}
#drawTimeSelect option {
    font-family: 'Merriweather', serif;
    background: #1a1a1a !important;
    color: #ffffff !important;
}
#drawTimeSelect:focus {
    background: rgba(0, 0, 0, 0.95) !important;
    border-color: #ffd700 !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px rgba(255, 215, 0, 0.2) !important;
}

/* ============================================
   LOTTERY TABLE
   ============================================ */
.lottery-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    table-layout: fixed;
    background: transparent;
}
.lottery-table th {
    font-family: 'Merriweather', serif;
    padding: 10px 4px;
    text-align: center;
    font-size: 14px;
    text-transform: uppercase;
    color: #ffffff;
    border-bottom: 2px solid rgba(255,215,0,0.15);
    letter-spacing: 1px;
    white-space: nowrap;
    font-weight: 700;
    background: rgba(0,0,0,0.5);
}
.lottery-table td {
    font-family: 'Merriweather', serif;
    padding: 8px 3px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    vertical-align: middle;
    background: rgba(0,0,0,0.3);
}

/* Game Row Background */
.game-row-1 { background: linear-gradient(135deg, rgba(255, 64, 0, 0.8), rgba(255, 140, 0, 0.4)) !important; border-left: 4px solid #ff8c00; }
.game-row-2 { background: linear-gradient(135deg, rgba(0, 128, 0, 0.8), rgba(0, 128, 0, 0.4)) !important; border-left: 4px solid #008000; }
.game-row-3 { background: linear-gradient(135deg, rgba(249, 10, 178, 0.8), rgba(0, 0, 255, 0.4)) !important; border-left: 4px solid #0000ff; }
.game-row-4 { background: linear-gradient(135deg, rgba(128, 0, 128, 0.8), rgba(128, 0, 128, 0.4)) !important; border-left: 4px solid #800080; }
.game-row-5 { background: linear-gradient(135deg, rgba(255, 0, 0, 0.8), rgba(255, 0, 0, 0.4)) !important; border-left: 4px solid #ff0000; }
.game-row-6 { background: linear-gradient(135deg, rgba(0, 128, 128, 0.8), rgba(0, 128, 128, 0.4)) !important; border-left: 4px solid #008080; }

/* Game Name */
.game-name {
    font-family: 'Merriweather', serif;
    font-weight: 800 !important;
    color: #f7f7f6 !important;
    font-size: 23px !important;
    padding: 12px 10px !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: transparent;
    border-radius: 6px;
}

/* Number Inputs */
.number-input {
    font-family: 'Merriweather', serif;
    width: 40px !important;
    height: 32px !important;
    text-align: center !important;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 4px !important;
    color: #ffffff !important;
    font-size: 15px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

.lottery-table td:nth-child(3), .lottery-table td:nth-child(4), 
.lottery-table td:nth-child(5), .lottery-table td:nth-child(6), 
.lottery-table td:nth-child(7), .lottery-table td:nth-child(8),
.lottery-table td:nth-child(9), .lottery-table td:nth-child(10), 
.lottery-table td:nth-child(11), .lottery-table td:nth-child(12) {
    width: 45px !important;
    min-width: 45px !important;
    padding: 4px 2px !important;
    text-align: center !important;
}

.lottery-table th:nth-child(3), .lottery-table th:nth-child(4), 
.lottery-table th:nth-child(5), .lottery-table th:nth-child(6), 
.lottery-table th:nth-child(7), .lottery-table th:nth-child(8),
.lottery-table th:nth-child(9), .lottery-table th:nth-child(10), 
.lottery-table th:nth-child(11), .lottery-table th:nth-child(12) {
    width: 45px !important;
    min-width: 45px !important;
    padding: 4px 2px !important;
    text-align: center !important;
}

.lottery-table td:nth-child(13), .lottery-table td:nth-child(14) {
    width: 70px !important;
    min-width: 70px !important;
    padding: 4px 2px !important;
    text-align: center !important;
}

.lottery-table th:nth-child(13), .lottery-table th:nth-child(14) {
    width: 70px !important;
    min-width: 70px !important;
    padding: 4px 2px !important;
    text-align: center !important;
}

.tot-qty-input, .tot-price-input {
    font-family: 'Merriweather', serif;
    width: 60px !important;
    height: 32px !important;
    text-align: center !important;
    background: rgba(255,215,0,0.05) !important;
    border: 2px solid rgba(255,215,0,0.2) !important;
    border-radius: 6px !important;
    color: #ffd700 !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

.grand-total-input {
    font-family: 'Merriweather', serif;
    width: 60px !important;
    height: 32px !important;
    text-align: center !important;
    background: rgba(255,215,0,0.1) !important;
    border: 2px solid rgba(255,215,0,0.4) !important;
    border-radius: 6px !important;
    color: #ffd700 !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    padding: 0 !important;
    margin: 0 auto !important;
    display: block !important;
    box-sizing: border-box !important;
}

/* WIN Column */
.win-cell {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 16px;
    min-width: 120px;
    position: relative;
    color: #ffffff;
    padding: 6px 8px;
}
.win-cell .result-time-display {
    display: block;
    font-family: 'Merriweather', serif;
    font-size: 12px;
    color: rgba(255,255,255,0.5);
    font-weight: 400;
    transition: color 0.3s ease;
    margin-top: 5px;
    min-height: 15px;
}

/* Flip Board */
.flip-board {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 140px;
    height: 70px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(180deg, #0c0c0d, #101011);
    border-radius: 8px;
    border: 2px solid rgba(255,215,0,0.4);
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    gap: 10px;
}

.flip-board .flip-number {
    display: inline-block;
    font-family: 'Merriweather', serif;
    font-size: 45px;
    color: #ffffff;
    font-weight: 700;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
    backface-visibility: hidden;
    transform-origin: center;
}

.spinning {
    animation: spinMiddle 0.15s linear infinite;
}

@keyframes spinMiddle {
    0% { transform: translateY(-15%) rotateX(45deg); opacity: 0.8; }
    50% { transform: translateY(0) rotateX(0deg); opacity: 1; }
    100% { transform: translateY(15%) rotateX(-45deg); opacity: 0.8; }
}

.stopping {
    animation: stopMiddle 0.8s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes stopMiddle {
    0% { transform: translateY(10%) rotateX(10deg); opacity: 0.9; }
    100% { transform: translateY(0) rotateX(0deg); opacity: 1; }
}

/* Viewers Online - Static Glow Dot */
.viewers-online {
    font-family: 'Merriweather', serif;
    color: #fafaf8;
    font-weight: 600;
    font-size: 15px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.viewers-online .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #00ff88;
    border-radius: 50%;
    box-shadow: 0 0 15px rgba(0, 255, 136, 0.8), 0 0 30px rgba(0, 255, 136, 0.4);
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {
    5%, 100% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.5), 0 0 20px rgba(0, 255, 136, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 0 20px rgba(0, 255, 136, 0.9), 0 0 40px rgba(0, 255, 136, 0.5);
        transform: scale(1.12);
    }
}

/* ============================================
   BUTTONS
   ============================================ */
.btn-buy {
    font-family: 'Merriweather', serif;
    background: linear-gradient(135deg, #28a745, #20c997);
    color: #ffffff;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-buy:hover { transform: scale(1.05); box-shadow: 0 5px 20px rgba(40, 167, 69, 0.3); }

.btn-reset {
    font-family: 'Merriweather', serif;
    background: linear-gradient(135deg, #ffc107, #ff8c00);
    color: #000;
    border: none;
    padding: 10px 30px;
    border-radius: 6px;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
}
.btn-reset:hover { transform: scale(1.05); }

.btn-view-results {
    font-family: 'Merriweather', serif;
    background: linear-gradient(135deg, #007bff, #00d2ff);
    color: #ffffff;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}
.btn-view-results:hover { transform: scale(1.05); color: #ffffff; text-decoration: none; }

/* ============================================
   CONFIRMED ORDER TABLE
   ============================================ */
.order-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    margin-top: 15px;
}
.order-table th {
    font-family: 'Merriweather', serif;
    padding: 8px 4px;
    text-align: center;
    font-size: 12px;
    text-transform: uppercase;
    color: #ffd700;
    border-bottom: 2px solid rgba(255,215,0,0.3);
    letter-spacing: 1px;
    font-weight: 700;
    background: rgba(255,215,0,0.05);
}
.order-table td {
    font-family: 'Merriweather', serif;
    color: #ffffff;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    padding: 8px 4px;
    text-align: center;
    font-size: 14px;
}
.order-table .order-game-name {
    font-family: 'Merriweather', serif;
    color: #ffffff;
    font-weight: 700;
    text-align: left;
    font-size: 16px;
    text-transform: uppercase;
}
.order-table .order-win {
    font-family: 'Merriweather', serif;
    font-weight: 700;
    font-size: 20px;
    color: #ffd700;
}
.order-table .order-number {
    font-family: 'Merriweather', serif;
    color: #ffd700;
    font-weight: 600;
    font-size: 14px;
}
.order-table .order-qty {
    font-family: 'Merriweather', serif;
    color: #ffd700;
    font-weight: 700;
    font-size: 15px;
}
.order-table .order-price {
    font-family: 'Merriweather', serif;
    color: #ffd700;
    font-weight: 700;
    font-size: 15px;
}

.grand-total-row td {
    padding-top: 12px;
    border-top: 2px solid rgba(255,215,0,0.3);
    background: rgba(255,215,0,0.05);
}
.grand-total-label {
    font-family: 'Merriweather', serif;
    font-weight: 900 !important;
    color: #ffd700 !important;
    font-size: 20px !important;
    text-align: right !important;
    letter-spacing: 2px !important;
    text-transform: uppercase !important;
    padding-right: 15px !important;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8) !important;
}

/* ============================================
   BOOKING HEADER
   ============================================ */
.booking-header {
    background: rgba(255,215,0,0.08);
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border-left: 3px solid #ffd700;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}
.booking-header .draw-time {
    font-family: 'Merriweather', serif;
    font-size: 18px;
    color: #ffd700;
    font-weight: 700;
}
.booking-header .booking-label {
    font-family: 'Merriweather', serif;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255,255,255,0.7);
    font-weight: 600;
}

/* ============================================
   POPUP
   ============================================ */
.login-popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.login-popup.show { display: flex; }
.login-popup-content {
    font-family: 'Merriweather', serif;
    background: rgba(20,20,30,0.95);
    padding: 35px 40px;
    border-radius: 15px;
    border: 2px solid rgba(255,215,0,0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}
.login-popup-content .icon { font-size: 48px; margin-bottom: 15px; }
.login-popup-content .icon .fa-exclamation-triangle { color: #ffc107; }
.login-popup-content .icon .fa-shopping-cart { color: #28a745; }
.login-popup-content h3 {
    font-family: 'Merriweather', serif;
    color: #ffd700;
    font-size: 20px;
    margin-bottom: 10px;
}
.login-popup-content p {
    font-family: 'Merriweather', serif;
    color: rgba(255,255,255,0.6);
    font-size: 15px;
    margin-bottom: 20px;
    line-height: 1.6;
}
.popup-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btn-close-popup {
    font-family: 'Merriweather', serif;
    border: none;
    padding: 12px 40px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    min-width: 100px;
}
.btn-close-popup:hover { transform: scale(1.05); }

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .header-section .logo img { max-height: 60px; }
    .header-section .header-right { justify-content: center; margin-top: 10px; width: 100%; }
    .info-item .label { font-size: 12px !important; }
    .info-item .value { font-size: 11px !important; }
    .tab-header { padding: 8px 15px; font-size: 12px; min-width: 120px; }
    .lottery-table { min-width: 750px !important; font-size: 12px !important; }
    .lottery-table th { font-size: 10px !important; padding: 6px 3px !important; }
    .lottery-table td { font-size: 11px !important; padding: 6px 3px !important; }
    .number-input { width: 28px !important; height: 24px !important; font-size: 11px !important; }
    .game-name { font-size: 14px !important; padding-left: 6px; }
    .win-cell { min-width: 90px !important; }
    .flip-board { width: 100px !important; height: 55px !important; }
    .flip-board .flip-number { font-size: 30px !important; }
    .grand-total-input { width: 45px !important; height: 25px !important; font-size: 13px !important; }
    .btn-buy, .btn-reset { padding: 6px 12px !important; font-size: 11px !important; }
}

@media (max-width: 576px) {
    .lottery-table { min-width: 700px !important; font-size: 10px !important; }
    .game-name { font-size: 12px !important; padding-left: 4px; }
    .win-cell { min-width: 80px !important; }
    .flip-board { width: 90px !important; height: 50px !important; }
    .flip-board .flip-number { font-size: 26px !important; }
    .lottery-table th { font-size: 8px !important; padding: 4px 1px !important; }
    .lottery-table td { font-size: 10px !important; padding: 4px 1px !important; }
    .number-input { width: 22px !important; height: 20px !important; font-size: 9px !important; }
}