"""
Cigar Lounge — Main Stylesheet
Dark Luxury Theme
"""

:root {
    --bg: #1a1410;
    --surface: #2d2318;
    --surface-hover: #3d3020;
    --border: #4a3a28;
    --gold: #c9a84c;
    --gold-light: #e0c87a;
    --text: #f5f0e8;
    --text-muted: #a89880;
    --success: #6b9b6b;
    --warning: #c98a4c;
    --error: #c95454;
    --radius: 8px;
    --radius-lg: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,0.4);
    --transition: 200ms ease;
}

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

body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', 'Noto Sans SC', sans-serif;
    font-size: 16px;
    line-height: 1.6;
    min-height: 100vh;
}

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

/* Typography */
h1, h2, h3 { font-family: 'Playfair Display', 'Noto Serif SC', serif; font-weight: 600; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

/* Layout */
.container { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.page { padding: 32px 0; }

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    text-decoration: none;
}
.btn-primary { background: var(--gold); color: #1a1410; }
.btn-primary:hover { background: var(--gold-light); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); }
.btn-danger { background: var(--error); color: white; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* Forms */
.form-group { margin-bottom: 16px; }
.form-label { display: block; margin-bottom: 6px; color: var(--text-muted); font-size: 0.85rem; }
.form-control {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 0.95rem;
    transition: border-color var(--transition);
}
.form-control:focus { outline: none; border-color: var(--gold); }
.form-control::placeholder { color: var(--text-muted); }

/* Tables */
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--text-muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; }
.table tr:hover td { background: var(--surface-hover); }

/* Badges */
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 0.75rem; }
.badge-success { background: rgba(107,155,107,0.2); color: var(--success); }
.badge-warning { background: rgba(201,138,76,0.2); color: var(--warning); }
.badge-error { background: rgba(201,84,84,0.2); color: var(--error); }
.badge-gold { background: rgba(201,168,76,0.2); color: var(--gold); }

/* Animations */
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes scaleIn { from { opacity: 0; transform: scale(0.95); } to { opacity: 1; transform: scale(1); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.6; } }
@keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
.animate-fade-in { animation: fadeIn 400ms ease-out forwards; }
.animate-scale-in { animation: scaleIn 300ms ease-out forwards; }

/* Stagger children */
.stagger > * { opacity: 0; animation: fadeIn 400ms ease-out forwards; }
.stagger > *:nth-child(1) { animation-delay: 50ms; }
.stagger > *:nth-child(2) { animation-delay: 100ms; }
.stagger > *:nth-child(3) { animation-delay: 150ms; }
.stagger > *:nth-child(4) { animation-delay: 200ms; }
.stagger > *:nth-child(5) { animation-delay: 250ms; }
.stagger > *:nth-child(6) { animation-delay: 300ms; }
.stagger > *:nth-child(7) { animation-delay: 350ms; }
.stagger > *:nth-child(8) { animation-delay: 400ms; }

/* Modal */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; backdrop-filter: blur(4px);
}
.modal { background: var(--surface); border-radius: var(--radius-lg); padding: 32px; max-width: 560px; width: 90%; max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.modal-close { background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; }
.modal-close:hover { color: var(--text); }

/* Flash messages */
.flash { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 0.9rem; }
.flash-success { background: rgba(107,155,107,0.15); border: 1px solid var(--success); color: var(--success); }
.flash-error { background: rgba(201,84,84,0.15); border: 1px solid var(--error); color: var(--error); }

/* Grid */
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1024px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; } }

/* Utility */
.text-gold { color: var(--gold); }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-right { text-align: right; }
.font-mono { font-family: 'JetBrains Mono', monospace; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.mb-24 { margin-bottom: 24px; }
