/* GoldDraw Raffles - Mobile First, Black / Brown / Gold Theme */
:root {
    --bg-dark: #0d0d0d;
    --bg-card: #1a1410;
    --bg-elevated: #241c16;
    --brown: #3d2b1f;
    --brown-light: #5c4033;
    --gold: #c9a227;
    --gold-light: #e8c547;
    --gold-dark: #a07820;
    --text: #f5e6c8;
    --text-muted: #a89070;
    --success: #4ade80;
    --danger: #f87171;
    --warning: #fbbf24;
    --radius: 12px;
    --shadow: 0 4px 20px rgba(0,0,0,0.4);
    --transition: 0.25s ease;
    --nav-height: 60px;
    --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-dark);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: var(--gold); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--gold-light); }

/* ========== NAVBAR ========== */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(13,13,13,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--brown);
    height: var(--nav-height);
    display: flex;
    align-items: center;
    padding: 0 1rem;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--gold);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.logo span { color: var(--text); font-weight: 400; }

.nav-links {
    display: none;
    gap: 1.5rem;
    list-style: none;
}
.nav-links a { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: var(--gold); }

.nav-actions { display: flex; align-items: center; gap: 0.75rem; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0d0d0d;
}
.btn-gold:hover { background: linear-gradient(135deg, var(--gold-light), var(--gold)); color: #0d0d0d; transform: translateY(-1px); }
.btn-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}
.btn-outline:hover { background: var(--gold); color: #0d0d0d; }
.btn-brown {
    background: var(--brown);
    color: var(--text);
}
.btn-brown:hover { background: var(--brown-light); }
.btn-sm { padding: 0.4rem 0.8rem; font-size: 0.85rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

.hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}
.hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--gold);
    transition: var(--transition);
}

/* Mobile menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-dark);
    z-index: 999;
    padding: 1.5rem;
    flex-direction: column;
    gap: 1rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
    color: var(--text);
    font-size: 1.1rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--brown);
}

/* ========== HERO ========== */
.hero {
    padding: 3rem 1rem 2.5rem;
    text-align: center;
    background: radial-gradient(ellipse at top, rgba(201,162,39,0.12) 0%, transparent 60%);
}
.hero h1 {
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.75rem;
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero p {
    color: var(--text-muted);
    font-size: 1rem;
    max-width: 480px;
    margin: 0 auto 1.5rem;
}
.hero-cta { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }

/* ========== SECTIONS ========== */
.section {
    padding: 2.5rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
}
.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--gold);
    text-align: center;
}
.section-sub {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

/* How it Works */
.steps {
    display: grid;
    gap: 1.25rem;
}
.step {
    background: var(--bg-card);
    border: 1px solid var(--brown);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.step-num {
    width: 36px;
    height: 36px;
    min-width: 36px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #0d0d0d;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1rem;
}
.step h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.step p { color: var(--text-muted); font-size: 0.9rem; }

/* ========== RAFFLE GRID ========== */
.raffle-grid {
    display: grid;
    gap: 1.25rem;
}
.raffle-card {
    background: var(--bg-card);
    border: 1px solid var(--brown);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition);
    display: flex;
    flex-direction: column;
}
.raffle-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(201,162,39,0.15);
    border-color: var(--gold-dark);
}
.raffle-img {
    position: relative;
    aspect-ratio: 4/3;
    background: var(--bg-elevated);
    overflow: hidden;
}
.raffle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.raffle-badge {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    background: rgba(0,0,0,0.75);
    color: var(--gold);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}
.raffle-badge.ready { background: rgba(74,222,128,0.2); color: var(--success); }
.raffle-badge.drawn { background: rgba(201,162,39,0.25); color: var(--gold); }

.raffle-body {
    padding: 1.1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.raffle-body h3 {
    font-size: 1.05rem;
    margin-bottom: 0.35rem;
    line-height: 1.3;
}
.raffle-price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 0.5rem;
}
.raffle-price small { font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

.progress-wrap {
    margin: 0.6rem 0;
}
.progress-bar {
    height: 6px;
    background: var(--brown);
    border-radius: 3px;
    overflow: hidden;
}
.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--gold-dark), var(--gold));
    border-radius: 3px;
    transition: width 0.5s ease;
}
.progress-text {
    display: flex;
    justify-content: space-between;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
}

.countdown {
    font-family: monospace;
    font-size: 0.9rem;
    color: var(--gold-light);
    margin: 0.5rem 0;
    font-weight: 600;
}
.raffle-actions {
    margin-top: auto;
    padding-top: 0.75rem;
}

/* ========== MODALS ========== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--bg-card);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-width: 440px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 1.5rem;
    border: 1px solid var(--brown);
    border-bottom: none;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
}
.modal-header h2 { font-size: 1.2rem; color: var(--gold); }
.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: var(--text-muted);
}
.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-elevated);
    border: 1px solid var(--brown);
    border-radius: 8px;
    color: var(--text);
    font-size: 1rem;
    transition: border-color var(--transition);
}
.form-control:focus {
    outline: none;
    border-color: var(--gold);
}
.form-control::placeholder { color: #6b5a45; }
.input-group {
    position: relative;
}
.input-group .toggle-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
}
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.25rem; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 0.5rem; }
.form-success { color: var(--success); font-size: 0.85rem; margin-top: 0.5rem; }

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.checkbox-group input { margin-top: 3px; accent-color: var(--gold); }

/* ========== USER DASHBOARD ========== */
.dashboard-header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--brown);
    padding: 1.25rem 1rem;
}
.dashboard-header h1 { font-size: 1.3rem; color: var(--gold); }
.dashboard-header p { color: var(--text-muted); font-size: 0.9rem; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--brown);
    border-radius: var(--radius);
    padding: 1rem;
    text-align: center;
}
.stat-card .num { font-size: 1.5rem; font-weight: 800; color: var(--gold); }
.stat-card .label { font-size: 0.8rem; color: var(--text-muted); }

.ticket-list { display: grid; gap: 0.75rem; }
.ticket-item {
    background: var(--bg-card);
    border: 1px solid var(--brown);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ticket-item .info h4 { font-size: 0.95rem; }
.ticket-item .info p { font-size: 0.8rem; color: var(--text-muted); }
.ticket-num {
    background: var(--brown);
    color: var(--gold);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
}

/* ========== ADMIN ========== */
.admin-layout {
    display: flex;
    min-height: 100vh;
}
.admin-sidebar {
    width: 240px;
    background: var(--bg-card);
    border-right: 1px solid var(--brown);
    padding: 1.25rem 0;
    display: none;
    flex-direction: column;
}
.admin-sidebar .logo { padding: 0 1.25rem 1.25rem; border-bottom: 1px solid var(--brown); margin-bottom: 1rem; }
.admin-nav { list-style: none; }
.admin-nav a {
    display: block;
    padding: 0.7rem 1.25rem;
    color: var(--text-muted);
    font-size: 0.9rem;
    border-left: 3px solid transparent;
}
.admin-nav a:hover, .admin-nav a.active {
    color: var(--gold);
    background: rgba(201,162,39,0.08);
    border-left-color: var(--gold);
}
.admin-main { flex: 1; padding: 1.25rem; overflow-x: auto; }
.admin-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.table-wrap { overflow-x: auto; }
table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
th, td {
    padding: 0.75rem 0.9rem;
    text-align: left;
    border-bottom: 1px solid var(--brown);
}
th { color: var(--gold); font-weight: 600; background: var(--bg-elevated); }
td { color: var(--text); }
.badge {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-published { background: rgba(74,222,128,0.15); color: var(--success); }
.badge-draft { background: rgba(168,144,112,0.2); color: var(--text-muted); }
.badge-ready { background: rgba(251,191,36,0.2); color: var(--warning); }
.badge-drawn { background: rgba(201,162,39,0.2); color: var(--gold); }

/* ========== FOOTER ========== */
.footer {
    background: var(--bg-card);
    border-top: 1px solid var(--brown);
    padding: 2rem 1rem;
    text-align: center;
    margin-top: 3rem;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.footer-links a { color: var(--text-muted); font-size: 0.9rem; }
.footer p { color: var(--text-muted); font-size: 0.8rem; }

/* ========== NOTIFICATIONS ========== */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-elevated);
    border: 1px solid var(--gold);
    color: var(--text);
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    z-index: 3000;
    font-size: 0.9rem;
    box-shadow: var(--shadow);
    animation: fadeIn 0.3s ease;
    max-width: 90%;
    text-align: center;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ========== UTILITIES ========== */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-gold { color: var(--gold); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }
.hidden { display: none !important; }
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}
.empty-state h3 { color: var(--text); margin-bottom: 0.5rem; }

/* ========== DESKTOP ========== */
@media (min-width: 768px) {
    .nav-links { display: flex; }
    .hamburger { display: none; }
    .hero h1 { font-size: 2.6rem; }
    .hero p { font-size: 1.1rem; }
    .steps { grid-template-columns: repeat(3, 1fr); }
    .step { flex-direction: column; text-align: center; align-items: center; }
    .raffle-grid { grid-template-columns: repeat(2, 1fr); }
    .modal-overlay { align-items: center; }
    .modal { border-radius: var(--radius); border: 1px solid var(--brown); max-height: 85vh; }
    .admin-sidebar { display: flex; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1024px) {
    .raffle-grid { grid-template-columns: repeat(3, 1fr); }
    .section { padding: 3rem 1.5rem; }
}
