/* ============================================================
   BingoBeet - Main Stylesheet v2.0
   ============================================================ */

:root {
    --primary: #f59e0b;
    --primary-dark: #d97706;
    --secondary: #1e293b;
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card2: #162032;
    --text-light: #94a3b8;
    --text-white: #f1f5f9;
    --success: #22c55e;
    --danger: #ef4444;
    --info: #3b82f6;
    --border: rgba(255,255,255,0.08);
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --radius: 16px;
    --radius-sm: 8px;
}

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

body {
    font-family: 'Tajawal', sans-serif;
    background: var(--bg-dark);
    color: var(--text-white);
    direction: rtl;
    overflow-x: hidden;
}

/* ==================== SCROLLBAR ==================== */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--primary); border-radius: 3px; }

/* ==================== NAVBAR ==================== */
#mainNav {
    background: rgba(15,23,42,0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
    transition: all 0.3s;
}
#mainNav.scrolled {
    background: rgba(15,23,42,0.99);
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}
.navbar-brand {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--primary) !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-brand img { border-radius: 8px; }
.nav-link {
    color: var(--text-light) !important;
    font-weight: 500;
    transition: color 0.2s;
    padding: 8px 14px !important;
}
.nav-link:hover, .nav-link.active { color: var(--primary) !important; }
.user-balance-nav {
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    padding: 6px 14px;
    border-radius: 20px;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.9rem;
}

/* ==================== HERO ==================== */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #0f172a 0%, #1a2744 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding-top: 80px;
}
.hero-section::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(245,158,11,0.12) 0%, transparent 70%);
    top: -100px; right: -100px;
    border-radius: 50%;
}
.hero-section::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    bottom: -50px; left: -50px;
    border-radius: 50%;
}
.hero-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.2); }
.hero-section .container { position: relative; z-index: 1; }
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.4);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--primary);
}
.hero-title {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: 16px;
}
.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-light);
    max-width: 500px;
}

/* Balls Animation */
.hero-balls-animation {
    position: relative;
    height: 400px;
}
.ball-item {
    position: absolute;
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 900;
    color: white;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4);
    animation: float 3s ease-in-out infinite;
}
.ball-1 { background: linear-gradient(135deg, #f59e0b, #d97706); top: 20%; right: 20%; animation-delay: 0s; }
.ball-2 { background: linear-gradient(135deg, #3b82f6, #1d4ed8); top: 10%; left: 30%; animation-delay: 0.5s; }
.ball-3 { background: linear-gradient(135deg, #22c55e, #16a34a); top: 50%; right: 10%; animation-delay: 1s; }
.ball-4 { background: linear-gradient(135deg, #ef4444, #dc2626); bottom: 30%; left: 20%; animation-delay: 1.5s; }
.ball-5 { background: linear-gradient(135deg, #8b5cf6, #6d28d9); bottom: 10%; right: 35%; animation-delay: 2s; }

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

/* ==================== LIVE BANNER ==================== */
.live-banner {
    background: linear-gradient(90deg, #dc2626, #b91c1c);
    padding: 12px 0;
    position: sticky;
    top: 70px;
    z-index: 100;
    border-bottom: 2px solid rgba(255,255,255,0.2);
}
.live-pulse {
    width: 12px; height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.3); }
}

/* ==================== SECTIONS ==================== */
.section-padding { padding: 80px 0; }
.bg-dark-custom { background: rgba(255,255,255,0.02); }
.section-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-white);
    margin-bottom: 8px;
}
.section-subtitle { color: var(--text-light); font-size: 1.1rem; }
.section-header::after {
    content: '';
    display: block;
    width: 60px; height: 4px;
    background: var(--primary);
    margin: 16px auto 0;
    border-radius: 2px;
}

/* ==================== DRAW CARDS ==================== */
.draw-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    transition: all 0.3s;
    height: 100%;
    position: relative;
    overflow: hidden;
}
.draw-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
}
.draw-card:hover {
    transform: translateY(-4px);
    border-color: rgba(245,158,11,0.3);
    box-shadow: 0 12px 40px rgba(245,158,11,0.15);
}
.draw-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.draw-type-badge {
    background: rgba(245,158,11,0.15);
    color: var(--primary);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.draw-status {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}
.status-upcoming { background: rgba(59,130,246,0.15); color: #60a5fa; }
.status-live { background: rgba(239,68,68,0.15); color: #f87171; animation: blink 1.5s infinite; }
.status-ended { background: rgba(148,163,184,0.15); color: #94a3b8; }
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.6} }

.draw-name { font-size: 1.1rem; font-weight: 700; margin-bottom: 16px; }
.draw-info { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.draw-info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-light);
    font-size: 0.9rem;
}
.draw-info-item i { color: var(--primary); width: 16px; }
.seats-progress .progress {
    height: 6px;
    background: rgba(255,255,255,0.1);
    border-radius: 3px;
    margin-bottom: 4px;
}
.seats-progress small { color: var(--text-light); font-size: 0.8rem; }

/* ==================== HOW TO PLAY ==================== */
.how-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px 24px;
    position: relative;
    transition: all 0.3s;
}
.how-card:hover { transform: translateY(-4px); border-color: rgba(245,158,11,0.3); }
.how-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 12px;
}
.how-step {
    position: absolute;
    top: 16px; left: 16px;
    width: 28px; height: 28px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.85rem;
}
.how-card h5 { font-weight: 700; margin-bottom: 8px; }
.how-card p { color: var(--text-light); font-size: 0.9rem; }

/* ==================== GAME CARDS ==================== */
.game-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 20px;
    text-align: center;
    transition: all 0.3s;
}
.game-card:hover { transform: translateY(-4px); border-color: rgba(245,158,11,0.4); }
.game-icon { font-size: 3rem; margin-bottom: 12px; }
.game-card h5 { font-weight: 700; margin-bottom: 8px; }
.game-card p { color: var(--text-light); font-size: 0.9rem; margin-bottom: 16px; }

/* ==================== FOOTER ==================== */
.footer {
    background: rgba(255,255,255,0.02);
    border-top: 1px solid var(--border);
    padding: 60px 0 30px;
}
.footer-link { color: var(--text-light); text-decoration: none; transition: color 0.2s; display: block; margin-bottom: 8px; }
.footer-link:hover { color: var(--primary); }

/* ==================== FORMS ==================== */
.form-control, .form-select {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid var(--border) !important;
    color: var(--text-white) !important;
    border-radius: var(--radius-sm) !important;
    padding: 12px 16px !important;
    font-family: 'Tajawal', sans-serif !important;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(245,158,11,0.15) !important;
    background: rgba(255,255,255,0.08) !important;
}
.form-control::placeholder { color: var(--text-light) !important; }
.form-label { color: var(--text-light); font-weight: 600; margin-bottom: 6px; }

/* ==================== BUTTONS ==================== */
.btn-warning {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark)) !important;
    border: none !important;
    color: white !important;
    font-weight: 700 !important;
    font-family: 'Tajawal', sans-serif !important;
    transition: all 0.3s !important;
}
.btn-warning:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(245,158,11,0.4) !important; }
.btn-outline-warning {
    border-color: var(--primary) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
    font-family: 'Tajawal', sans-serif !important;
}
.btn-outline-warning:hover { background: var(--primary) !important; color: white !important; }
.btn-outline-light { font-family: 'Tajawal', sans-serif !important; font-weight: 600 !important; }

/* ==================== ALERTS ==================== */
.alert { border-radius: var(--radius-sm) !important; font-family: 'Tajawal', sans-serif !important; }

/* ==================== MODAL ==================== */
.modal-content {
    background: var(--bg-card) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius) !important;
    color: var(--text-white) !important;
}
.modal-header { border-bottom: 1px solid var(--border) !important; }
.modal-footer { border-top: 1px solid var(--border) !important; }
.btn-close { filter: invert(1) !important; }

/* ==================== SEATS GRID ==================== */
.seats-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 6px;
    padding: 20px;
}
.seat-btn {
    aspect-ratio: 1;
    border: 2px solid var(--border);
    border-radius: 8px;
    background: var(--bg-card2);
    color: var(--text-light);
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.seat-btn:hover:not(.booked):not(.mine) {
    border-color: var(--primary);
    background: rgba(245,158,11,0.15);
    color: var(--primary);
    transform: scale(1.05);
}
.seat-btn.booked { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.4); color: #f87171; cursor: not-allowed; }
.seat-btn.mine { background: rgba(34,197,94,0.15); border-color: rgba(34,197,94,0.4); color: #4ade80; }
.seat-btn.selected { background: rgba(245,158,11,0.3); border-color: var(--primary); color: var(--primary); }

/* ==================== BINGO CARD ==================== */
.bingo-card {
    background: var(--bg-card);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: all 0.3s;
}
.bingo-card.winner-card { border-color: var(--primary); box-shadow: 0 0 30px rgba(245,158,11,0.4); }
.bingo-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-bottom: 1px solid var(--border);
}
.bingo-row:last-child { border-bottom: none; }
.bingo-cell {
    padding: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    border-left: 1px solid var(--border);
    transition: all 0.3s;
}
.bingo-cell:last-child { border-left: none; }
.bingo-cell.drawn {
    background: rgba(245,158,11,0.2);
    color: var(--primary);
}
.bingo-cell.winner-cell {
    background: var(--primary);
    color: white;
    animation: winPulse 0.5s ease;
}
@keyframes winPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* ==================== LIVE PAGE ==================== */
.live-stream-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: #000;
}
.live-stream-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.drawn-numbers-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px;
}
.drawn-number-ball {
    width: 44px; height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 0.9rem;
    color: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.drawn-number-ball.last {
    width: 56px; height: 56px;
    font-size: 1.1rem;
    animation: newBall 0.5s ease;
    box-shadow: 0 0 20px rgba(245,158,11,0.6);
}
@keyframes newBall {
    0% { transform: scale(0) rotate(-180deg); opacity: 0; }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}

/* ==================== PRIZES TABLE ==================== */
.prizes-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 6px;
}
.prizes-table thead th {
    background: rgba(245,158,11,0.1);
    color: var(--primary);
    padding: 12px 16px;
    font-weight: 700;
    border: none;
}
.prizes-table tbody tr {
    background: var(--bg-card);
    transition: all 0.2s;
}
.prizes-table tbody tr:hover { background: rgba(255,255,255,0.05); }
.prizes-table tbody td {
    padding: 12px 16px;
    border: none;
    color: var(--text-white);
}
.prizes-table tbody td:first-child { border-radius: 8px 0 0 8px; }
.prizes-table tbody td:last-child { border-radius: 0 8px 8px 0; }
.prize-awarded { color: var(--success); font-weight: 700; }
.prize-remaining { color: var(--primary); font-weight: 700; }

/* ==================== ADMIN SIDEBAR ==================== */
.admin-sidebar {
    width: 260px;
    min-height: 100vh;
    background: var(--secondary);
    border-left: 1px solid var(--border);
    position: fixed;
    right: 0;
    top: 0;
    z-index: 1000;
    transition: transform 0.3s;
    overflow-y: auto;
}
.admin-sidebar .sidebar-logo {
    padding: 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
}
.admin-sidebar .sidebar-logo img { height: 40px; border-radius: 8px; }
.admin-sidebar .sidebar-logo span { font-weight: 800; font-size: 1.1rem; color: var(--primary); }
.sidebar-nav { padding: 16px 0; }
.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.2s;
    border-right: 3px solid transparent;
}
.sidebar-nav-item:hover, .sidebar-nav-item.active {
    color: var(--primary);
    background: rgba(245,158,11,0.08);
    border-right-color: var(--primary);
}
.sidebar-nav-item i { width: 20px; text-align: center; }
.sidebar-section-title {
    padding: 8px 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 8px;
}
.admin-main { margin-right: 260px; padding: 24px; min-height: 100vh; }

/* ==================== STATS CARDS ==================== */
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-icon {
    width: 56px; height: 56px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.stat-icon.yellow { background: rgba(245,158,11,0.15); color: var(--primary); }
.stat-icon.green  { background: rgba(34,197,94,0.15);  color: var(--success); }
.stat-icon.blue   { background: rgba(59,130,246,0.15); color: #60a5fa; }
.stat-icon.red    { background: rgba(239,68,68,0.15);  color: #f87171; }
.stat-value { font-size: 1.8rem; font-weight: 900; line-height: 1; }
.stat-label { color: var(--text-light); font-size: 0.9rem; margin-top: 4px; }

/* ==================== DATA TABLE ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table thead th {
    background: rgba(255,255,255,0.03);
    color: var(--text-light);
    padding: 12px 16px;
    font-weight: 700;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--border); transition: background 0.2s; }
.data-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.data-table tbody td { padding: 12px 16px; font-size: 0.9rem; }
.data-table tbody tr:last-child { border-bottom: none; }

/* ==================== BADGES ==================== */
.badge-pending  { background: rgba(245,158,11,0.15); color: var(--primary); padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.badge-approved { background: rgba(34,197,94,0.15);  color: var(--success); padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.badge-rejected { background: rgba(239,68,68,0.15);  color: #f87171;        padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; }
.badge-live     { background: rgba(239,68,68,0.15);  color: #f87171;        padding: 4px 10px; border-radius: 20px; font-size: 0.8rem; font-weight: 700; animation: blink 1.5s infinite; }

/* ==================== PAGE HEADER ==================== */
.page-header {
    background: linear-gradient(135deg, var(--secondary), var(--bg-dark));
    padding: 60px 0 40px;
    margin-top: 70px;
    border-bottom: 1px solid var(--border);
}
.page-header h1 { font-size: 2rem; font-weight: 800; }
.page-header p { color: var(--text-light); }

/* ==================== CARD ==================== */
.bb-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.bb-card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.bb-card-header h5 { font-weight: 700; margin: 0; }
.bb-card-body { padding: 20px; }

/* ==================== TOAST NOTIFICATION ==================== */
#toastContainer {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 360px;
}
.bb-toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: var(--shadow);
    animation: slideIn 0.3s ease;
    border-right: 4px solid var(--primary);
}
.bb-toast.success { border-right-color: var(--success); }
.bb-toast.error   { border-right-color: var(--danger); }
.bb-toast.info    { border-right-color: var(--info); }
.bb-toast .toast-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }
.bb-toast .toast-msg  { font-size: 0.9rem; line-height: 1.4; }
@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-right: 0; padding: 16px; }
    .seats-grid { grid-template-columns: repeat(6, 1fr); gap: 4px; padding: 12px; }
    .hero-title { font-size: 2.2rem; }
    .section-padding { padding: 50px 0; }
}
@media (max-width: 480px) {
    .seats-grid { grid-template-columns: repeat(5, 1fr); }
    .drawn-numbers-display { gap: 6px; }
    .drawn-number-ball { width: 36px; height: 36px; font-size: 0.8rem; }
}

/* ==================== UTILITIES ==================== */
.text-primary-custom { color: var(--primary) !important; }
.bg-card { background: var(--bg-card) !important; }
.border-custom { border-color: var(--border) !important; }
.fw-900 { font-weight: 900 !important; }
.cursor-pointer { cursor: pointer; }
.gap-2 { gap: 8px; }
.rounded-custom { border-radius: var(--radius) !important; }
