/* ============================================
   STYLE.CSS — Base Styles
   Baad mein har page ka CSS yahan add hoga
   ============================================ */

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --bg: #0a0a0a;
    --bg2: #111;
    --card: #1a1a1a;
    --card2: #222;
    --gold: #d4a017;
    --gold-light: #f5c842;
    --gold-dim: #8b6914;
    --crimson: #dc2626;
    --crimson-dark: #991b1b;
    --fg: #f5f5f0;
    --muted: #777;
    --border: #2a2a2a;
    --success: #166534;
    --success-border: #22c55e;
    --error: #7f1d1d;
    --error-border: #ef4444;
    --warning: #78350f;
    --warning-border: #f59e0b;
    --info: #1e3a5f;
    --info-border: #3b82f6;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    line-height: 1.6;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-light); }

/* --- Container --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* --- Flash Messages --- */
.flash-msg {
    padding: 14px 20px;
    border-radius: 8px;
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    animation: flashIn 0.4s ease;
    position: relative;
    z-index: 1000;
}
.flash-close {
    background: none; border: none; color: inherit;
    font-size: 1.3rem; cursor: pointer; padding: 0 4px; opacity: 0.7;
}
.flash-close:hover { opacity: 1; }
.flash-success { background: var(--success); border: 1px solid var(--success-border); color: #bbf7d0; }
.flash-error { background: var(--error); border: 1px solid var(--error-border); color: #fecaca; }
.flash-warning { background: var(--warning); border: 1px solid var(--warning-border); color: #fef3c7; }
.flash-info { background: var(--info); border: 1px solid var(--info-border); color: #bfdbfe; }

@keyframes flashIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* --- Navigation --- */
.main-nav {
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 500;
}
.nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
}
.nav-brand {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--gold) !important;
    display: flex;
    align-items: center;
    gap: 8px;
}
.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}
.nav-links a {
    font-size: 0.9rem;
    color: var(--muted);
    transition: color 0.2s;
}
.nav-links a:hover { color: var(--fg); }
.nav-balance {
    background: rgba(212,160,23,0.1);
    border: 1px solid var(--gold-dim);
    padding: 6px 14px;
    border-radius: 8px;
    font-weight: 700;
    color: var(--gold-light) !important;
    font-size: 0.85rem;
}
.nav-user {
    font-size: 0.8rem;
    color: var(--muted);
    border-left: 1px solid var(--border);
    padding-left: 16px;
}
.nav-logout {
    color: var(--crimson) !important;
    font-size: 0.85rem;
}
.nav-register {
    background: var(--gold);
    color: #000 !important;
    padding: 8px 18px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    transition: all 0.2s;
}
.nav-register:hover {
    background: var(--gold-light);
    box-shadow: 0 4px 15px rgba(212,160,23,0.3);
}
.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 8px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.1rem;
}

/* --- Footer --- */
.main-footer {
    background: var(--bg2);
    border-top: 1px solid var(--border);
    padding: 20px;
    text-align: center;
    margin-top: 40px;
}
.main-footer p {
    font-size: 0.8rem;
    color: var(--muted);
}

/* --- Cards --- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-gold {
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: #000;
}
.btn-gold:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(212,160,23,0.4);
    transform: translateY(-1px);
}
.btn-red {
    background: linear-gradient(135deg, var(--crimson-dark), var(--crimson));
    color: #fff;
}
.btn-red:hover:not(:disabled) {
    box-shadow: 0 4px 20px rgba(220,38,38,0.4);
    transform: translateY(-1px);
}
.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--fg);
}
.btn-outline:hover { border-color: var(--gold-dim); color: var(--gold); }
.btn-sm { padding: 6px 14px; font-size: 0.8rem; }

/* --- Forms --- */
.form-group { margin-bottom: 16px; }
.form-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.form-input {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px rgba(212,160,23,0.1);
}
.form-input.error { border-color: var(--crimson); }
.form-error {
    font-size: 0.8rem;
    color: var(--crimson);
    margin-top: 4px;
}
.form-select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
}

/* --- Grid --- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

/* --- Stats Card --- */
.stat-card {
    background: linear-gradient(145deg, var(--card), var(--bg2));
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}
.stat-card .stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--muted);
    margin-bottom: 4px;
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 800;
}

/* --- Table --- */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    background: var(--bg2);
    padding: 12px 16px;
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    border-bottom: 1px solid var(--border);
}
.data-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
}
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

/* --- Badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-gold { background: rgba(212,160,23,0.15); color: var(--gold-light); }
.badge-silver { background: rgba(192,192,192,0.15); color: #ccc; }
.badge-bronze { background: rgba(205,127,50,0.15); color: #cd7f32; }
.badge-green { background: rgba(34,197,94,0.15); color: #4ade80; }
.badge-red { background: rgba(239,68,68,0.15); color: #f87171; }
.badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }
.badge-yellow { background: rgba(245,158,11,0.15); color: #fbbf24; }

/* --- Responsive --- */
@media (max-width: 768px) {
    .nav-links { display: none; flex-direction: column; position: absolute; top: 60px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 16px 20px; gap: 12px; }
    .nav-links.show { display: flex; }
    .nav-toggle { display: block; }
    .nav-user { border-left: none; padding-left: 0; }
    .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
    .container { padding: 12px; }
}

/* --- Page Title --- */
.page-title {
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 6px;
}
.page-subtitle {
    font-size: 0.9rem;
    color: var(--muted);
    margin-bottom: 24px;
}

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 0.9rem; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

/* --- Text Utils --- */
.text-gold { color: var(--gold-light); }
.text-crimson { color: var(--crimson); }
.text-muted { color: var(--muted); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.fw-bold { font-weight: 700; }

/* ============================================
   AUTH PAGES — Login, Register, Admin Login
   ============================================ */

/* Background glow effect */
.auth-bg {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background:
        radial-gradient(ellipse 600px 400px at 30% 20%, rgba(212,160,23,0.06) 0%, transparent 70%),
        radial-gradient(ellipse 500px 500px at 70% 80%, rgba(220,38,38,0.04) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* Center wrapper */
.auth-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 20px;
    position: relative;
    z-index: 1;
}

/* Auth card */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(160deg, #1a1a1a 0%, #111 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px 32px;
    position: relative;
    overflow: hidden;
}
.auth-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-light), var(--gold-dim));
}

/* Brand section */
.auth-brand {
    text-align: center;
    margin-bottom: 28px;
}
.auth-brand h1 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-top: 12px;
}
.auth-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.3rem;
    background: linear-gradient(135deg, var(--gold-dim), var(--gold));
    color: #000;
}
.admin-icon {
    background: linear-gradient(135deg, var(--crimson-dark), var(--crimson)) !important;
    color: #fff !important;
}

/* Password toggle */
.input-password-wrap {
    position: relative;
}
.input-password-wrap .form-input {
    padding-right: 48px;
}
.toggle-pass {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--muted);
    cursor: pointer;
    padding: 8px;
    font-size: 0.9rem;
    transition: color 0.2s;
}
.toggle-pass:hover { color: var(--gold); }

/* Full width button */
.btn-full { width: 100%; padding: 12px 24px; font-size: 1rem; }

/* Footer text */
.auth-footer-text {
    text-align: center;
    font-size: 0.85rem;
    color: var(--muted);
    margin-top: 20px;
}
.auth-footer-text a { color: var(--gold); font-weight: 600; }

/* Form hint */
.form-hint {
    font-size: 0.75rem;
    color: #555;
    margin-top: 4px;
}

/* Form alert (general error box) */
.form-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: flashIn 0.3s ease;
}
.form-alert-error {
    background: var(--error);
    border: 1px solid var(--error-border);
    color: #fecaca;
}

/* ============================================
   INDEX + RAFFLE PAGES CSS
   ============================================ */

/* Gold Shimmer Text */
.gold-shimmer {
    background: linear-gradient(110deg, var(--gold-dim) 0%, var(--gold) 30%, var(--gold-light) 50%, var(--gold) 70%, var(--gold-dim) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: shimmer 3s linear infinite;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hero Section */
.hero-section {
    text-align: center;
    padding: 60px 20px 40px;
    position: relative;
}
.hero-title { font-size: 2.8rem; font-weight: 900; }
.hero-subtitle { color: var(--muted); font-size: 1.1rem; margin-top: 8px; }

/* Stats Row */
.stats-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    max-width: 600px;
    margin: 0 auto 30px;
}

/* Raffles Grid */
.raffles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

/* Raffle Card */
.raffle-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.3s;
    position: relative;
}
.raffle-card:hover {
    border-color: var(--gold-dim);
    transform: translateY(-3px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
}
.raffle-upcoming { opacity: 0.7; }

.raffle-card-img {
    height: 180px;
    background: var(--bg2);
    position: relative;
    overflow: hidden;
}
.raffle-card-img img {
    width: 100%; height: 100%; object-fit: cover;
}
.raffle-card-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; color: #333;
}

.raffle-card-body { padding: 18px; }
.raffle-card-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 12px; }

.raffle-card-meta {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}
.meta-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; }
.meta-value { font-size: 0.9rem; font-weight: 700; }

/* Progress Bar */
.raffle-progress {
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}
.raffle-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-light));
    border-radius: 3px;
    transition: width 0.5s;
}
.raffle-progress-text {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 4px;
    text-align: right;
}

/* Draw Timer */
.raffle-timer {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold-light);
    text-align: center;
    padding: 8px;
    background: rgba(212,160,23,0.05);
    border-radius: 6px;
    margin-top: 8px;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 20px;
}
.breadcrumb a { color: var(--gold); }
.breadcrumb i { font-size: 0.6rem; }

/* Raffle Detail Grid */
.raffle-detail-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 20px;
}
@media (max-width: 768px) {
    .raffle-detail-grid { grid-template-columns: 1fr; }
}

.raffle-detail-img {
    width: 100%; height: 280px; object-fit: cover;
    border-radius: 10px;
    margin-bottom: 16px;
}
.raffle-detail-placeholder {
    width: 100%; height: 280px;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg2); border-radius: 10px; margin-bottom: 16px;
    font-size: 4rem; color: #333;
}
.raffle-detail-title { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.raffle-detail-desc { color: var(--muted); font-size: 0.9rem; line-height: 1.7; }

/* Draw Timer Box */
.draw-timer-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg2);
    border-radius: 10px;
    border: 1px solid var(--border);
}
.draw-timer-label { font-size: 0.8rem; color: var(--muted); }
.draw-timer-value {
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gold-light);
}

/* Prize Breakdown */
.prize-breakdown h3 { font-size: 0.9rem; margin-bottom: 10px; }
.prize-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 6px;
}
.prize-row-1st { background: rgba(212,160,23,0.06); border: 1px solid rgba(212,160,23,0.15); }
.prize-row-2nd { background: rgba(192,192,192,0.04); border: 1px solid rgba(192,192,192,0.1); }
.prize-row-3rd { background: rgba(205,127,50,0.04); border: 1px solid rgba(205,127,50,0.1); }

/* Buy Box */
.buy-box { border-color: var(--gold-dim); position: relative; overflow: hidden; }
.buy-box::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--gold-dim), var(--gold-light), var(--gold-dim));
}
.buy-box-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 4px; }

.buy-qty-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 16px;
}
.buy-qty-option {
    display: flex; flex-direction: column; align-items: center;
    padding: 12px 8px;
    background: var(--bg);
    border: 2px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}
.buy-qty-option input { display: none; }
.buy-qty-option:has(input:checked) {
    border-color: var(--gold);
    background: rgba(212,160,23,0.08);
}
.buy-qty-option.disabled {
    opacity: 0.35; cursor: not-allowed; pointer-events: none;
}
.qty-num { font-size: 1.3rem; font-weight: 800; }
.qty-cost { font-size: 0.7rem; color: var(--muted); margin-top: 2px; }

.buy-summary {
    background: var(--bg);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
}
.buy-summary-row {
    display: flex; justify-content: space-between;
    font-size: 0.85rem; padding: 4px 0;
}
.buy-summary-row span:last-child { font-weight: 600; }

/* Success Box */
.buy-success-box {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px;
    background: var(--success); border: 1px solid var(--success-border);
    border-radius: 10px; color: #bbf7d0; margin-bottom: 16px;
    animation: flashIn 0.4s ease;
}
.buy-success-box > i { font-size: 1.3rem; margin-top: 2px; }
.success-tickets {
    display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px;
}
.ticket-num-badge {
    display: inline-block; padding: 3px 10px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px; font-family: monospace;
    font-size: 0.8rem; font-weight: 700;
}

/* My Tickets in Raffle */
.my-tickets-list { max-height: 300px; overflow-y: auto; }
.my-ticket-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.my-ticket-item:last-child { border-bottom: none; }
.my-ticket-num {
    font-family: monospace; font-weight: 700;
    font-size: 0.95rem; letter-spacing: 1px;
}

/* Perforated Line */
.perf-line {
    border: none;
    border-top: 2px dashed #333;
    margin: 10px 0;
    position: relative;
}

/* Dashboard Cards */
.card-link {
    display: flex; flex-direction: column;
    align-items: center; gap: 8px;
    text-align: center; padding: 20px;
    transition: all 0.2s; cursor: pointer;
}
.card-link:hover {
    border-color: var(--gold-dim);
    transform: translateY(-2px);
}
.card-link i { font-size: 1.5rem; }
.card-link span { font-size: 0.85rem; font-weight: 600; }

/* Balance Highlight */
.balance-highlight {
    display: flex; align-items: center; gap: 10px;
    padding: 16px 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
}

/* Quick Amount Buttons */
.quick-amounts { display: flex; gap: 8px; flex-wrap: wrap; }

/* Table Responsive */
.table-responsive { overflow-x: auto; }

/* Tickets Grid */
.tickets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.my-ticket-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.2s;
}
.my-ticket-card:hover { border-color: var(--gold-dim); }
.my-ticket-card.ticket-won {
    border-color: var(--gold);
    box-shadow: 0 0 20px rgba(212,160,23,0.1);
}
.ticket-won-stamp {
    position: absolute; top: 10px; right: -25px;
    background: var(--gold);
    color: #000; font-weight: 900; font-size: 0.7rem;
    padding: 2px 30px;
    transform: rotate(45deg);
    text-transform: uppercase;
    letter-spacing: 2px;
}
.ticket-card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 6px;
}
.ticket-card-number {
    font-family: monospace; font-size: 1.2rem;
    font-weight: 800; letter-spacing: 2px;
    text-align: center; padding: 8px 0;
}
.ticket-card-footer {
    font-size: 0.7rem; text-align: center;
}
.ticket-won .ticket-card-number {
    background: linear-gradient(110deg, var(--gold-dim), var(--gold-light), var(--gold-dim));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 3s linear infinite;
}

/* Wins List */
.wins-list { display: flex; flex-direction: column; gap: 12px; }
.win-card {
    display: flex; justify-content: space-between; align-items: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    transition: border-color 0.2s;
}
.win-card:hover { border-color: var(--gold-dim); }
.win-raffle-name { font-weight: 600; margin-top: 6px; }
.win-ticket-num {
    font-family: monospace; font-size: 0.85rem;
    color: var(--muted); margin-top: 2px;
}
.win-amount { font-size: 1.3rem; font-weight: 800; color: var(--gold-light); }
.win-status { margin-top: 4px; }
.win-date { font-size: 0.75rem; margin-top: 4px; }

@media (max-width: 600px) {
    .hero-title { font-size: 2rem; }
    .stats-row { grid-template-columns: 1fr; max-width: 100%; }
    .raffles-grid { grid-template-columns: 1fr; }
    .buy-qty-group { grid-template-columns: repeat(2, 1fr); }
    .raffle-card-meta { grid-template-columns: 1fr; gap: 4px; }
    .win-card { flex-direction: column; align-items: flex-start; gap: 10px; }
    .tickets-grid { grid-template-columns: 1fr; }
}

/* ============================================
   ADMIN LAYOUT — Sidebar + Content
   ============================================ */

.admin-body { background: var(--bg); }

.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.admin-sidebar {
    width: 250px;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 600;
    transition: transform 0.3s;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--border);
    color: var(--crimson);
    font-size: 1.2rem;
}
.sidebar-brand-name { font-weight: 800; font-size: 1rem; color: var(--fg); }
.sidebar-brand-sub { font-size: 0.7rem; color: var(--muted); }

.sidebar-nav {
    flex: 1;
    padding: 12px 10px;
    overflow-y: auto;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--muted);
    transition: all 0.2s;
    margin-bottom: 2px;
}
.sidebar-link:hover {
    background: rgba(255,255,255,0.04);
    color: var(--fg);
}
.sidebar-link.active {
    background: rgba(212,160,23,0.1);
    color: var(--gold-light);
    font-weight: 600;
}
.sidebar-link i { width: 20px; text-align: center; font-size: 0.85rem; }
.sidebar-logout { color: var(--crimson) !important; }
.sidebar-logout:hover { background: rgba(220,38,38,0.08) !important; }

.sidebar-footer {
    padding: 10px;
    border-top: 1px solid var(--border);
}

/* Main Content */
.admin-main {
    flex: 1;
    margin-left: 250px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
    position: sticky;
    top: 0;
    z-index: 100;
}
.topbar-title { font-size: 1.2rem; font-weight: 700; }
.topbar-admin-badge {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 14px;
    background: rgba(212,160,23,0.1);
    border: 1px solid var(--gold-dim);
    border-radius: 8px;
    font-size: 0.8rem;
    color: var(--gold-light);
    font-weight: 600;
}

.admin-content {
    flex: 1;
    padding: 24px;
}

/* Sidebar toggle (mobile) */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 12px; left: 12px;
    z-index: 700;
    background: var(--card);
    border: 1px solid var(--border);
    color: var(--fg);
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1rem;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 550;
}
.sidebar-overlay.show { display: block; }

/* Admin Stat Cards (with icon) */
.admin-stat {
    display: flex;
    align-items: center;
    gap: 14px;
    text-align: left;
}
.admin-stat-icon {
    width: 46px; height: 46px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}
.stat-sub { font-size: 0.7rem; margin-top: 2px; }

/* Card Header Row */
.card-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
}
.card-header-row h2, .card-header-row h3 { margin: 0; }

/* Mini Raffle Row (dashboard) */
.mini-raffle-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.mini-raffle-row:last-child { border-bottom: none; }

/* Activity List (dashboard) */
.activity-list { max-height: 320px; overflow-y: auto; }
.activity-item {
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-action { font-size: 0.8rem; font-weight: 600; font-family: monospace; }
.activity-desc { font-size: 0.8rem; }
.activity-meta { font-size: 0.7rem; margin-top: 2px; }

/* Action Buttons Group */
.action-btns {
    display: flex;
    gap: 4px;
    flex-wrap: nowrap;
}

/* Current Image Preview */
.current-img-preview {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    display: inline-block;
}

/* Admin Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        transform: translateX(-100%);
    }
    .admin-sidebar.open {
        transform: translateX(0);
    }
    .admin-main {
        margin-left: 0;
    }
    .sidebar-toggle {
        display: block;
    }
    .admin-topbar {
        padding-left: 56px;
    }
    .admin-content {
        padding: 16px;
    }
    .admin-stat {
        flex-direction: column;
        text-align: center;
    }
    .action-btns {
        flex-wrap: wrap;
    }
}