:root {
    --bg-main: #0d0d1a;
    --bg-card: rgba(30, 30, 45, 0.6);
    --bg-glass: rgba(20, 20, 35, 0.7);
    --border-glass: rgba(255, 255, 255, 0.08);
    --accent-primary: #6B2D4F;
    --accent-hover: #8A3A66;
    --accent-gold: #D4AF37;
    --text-main: #f5f5f5;
    --text-muted: #a0a0b0;
    --danger: #cf4b4b;
    --font: 'Inter', -apple-system, sans-serif;
    --radius: 16px;
    --radius-sm: 8px;
    --transition: 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

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

body {
    font-family: var(--font);
    background-color: var(--bg-main);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    font-size: 16px;
}

input, select, textarea, button {
    font-family: inherit;
    font-size: 1rem;
}

.screen {
    display: none;
    min-height: 100vh;
    flex-direction: column;
}

.screen.active {
    display: flex;
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-glass);
}

.glass-box {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 12px;
}

/* Auth */
#auth-screen {
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: radial-gradient(circle at top, #1a1a3a 0%, var(--bg-main) 70%);
}

.auth-container {
    width: 100%;
    max-width: 400px;
    padding: 30px 20px;
    text-align: center;
}

.auth-logo { font-size: 3rem; margin-bottom: 10px; }
.auth-title { font-weight: 300; letter-spacing: 2px; margin-bottom: 30px; color: var(--accent-gold); }

.auth-tabs { display: flex; margin-bottom: 20px; border-bottom: 1px solid var(--border-glass); }
.auth-tab {
    flex: 1; background: none; border: none; color: var(--text-muted); padding: 10px;
    cursor: pointer; border-bottom: 2px solid transparent; transition: var(--transition);
}
.auth-tab.active { color: var(--text-main); border-bottom-color: var(--accent-gold); }

.auth-form { display: none; flex-direction: column; gap: 15px; }
.auth-form.active { display: flex; animation: fadeIn 0.3s; }

input, select, textarea {
    width: 100%; padding: 12px 16px; border-radius: var(--radius-sm);
    background: rgba(0,0,0,0.3); border: 1px solid var(--border-glass);
    color: var(--text-main); outline: none; transition: var(--transition);
}
input:focus, select:focus, textarea:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, 0.2);
}

select option {
    background-color: var(--bg-main);
    color: var(--text-main);
}

.btn {
    padding: 12px 20px; border-radius: var(--radius-sm); border: none;
    cursor: pointer; font-weight: 500; transition: var(--transition);
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-primary { background: var(--accent-primary); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-secondary { background: rgba(255,255,255,0.1); color: var(--text-main); }
.btn-secondary:hover { background: rgba(255,255,255,0.15); }
.btn-danger { background: rgba(207, 75, 75, 0.2); color: var(--danger); border: 1px solid var(--danger); }
.btn-danger:hover { background: rgba(207, 75, 75, 0.3); }
.btn-full { width: 100%; }
.btn-icon { background: none; padding: 8px; font-size: 1.2rem; cursor: pointer; border: none; }

/* Main App */
.app-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; position: sticky; top: 0; z-index: 10;
}
.app-title { font-size: 1.2rem; font-weight: 500; color: var(--accent-gold); }

.view { display: none; flex: 1; padding: 20px 20px 100px; animation: fadeIn 0.3s; }
.view.active { display: block; }
.view-title { font-weight: 300; margin-bottom: 20px; font-size: 1.5rem; }
.section-title { font-size: 1.1rem; font-weight: 500; margin: 30px 0 15px; color: var(--text-muted); }

.mb { margin-bottom: 15px; }
.mt { margin-top: 15px; }
.text-muted { color: var(--text-muted); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.dashboard-stats { padding: 20px; text-align: center; }
.stat-value { display: block; font-size: 2.5rem; font-weight: 700; color: var(--accent-gold); }
.stat-label { font-size: 0.9rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }

.search-input { margin-bottom: 20px; width: 100%; }

/* Cards */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.card-list.mini .card { padding: 10px; font-size: 0.9rem; }
.card {
    background: var(--bg-card); border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm); padding: 16px; cursor: pointer;
    transition: var(--transition);
}
.card:hover { transform: translateY(-2px); border-color: rgba(255,255,255,0.2); }
.card-title { font-weight: 600; font-size: 1.1rem; margin-bottom: 4px; }
.card-meta { font-size: 0.85rem; color: var(--text-muted); }
.badge {
    display: inline-block; padding: 4px 8px; border-radius: 12px;
    font-size: 0.75rem; font-weight: 600; background: rgba(255,255,255,0.1);
}

.empty-state { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.empty-icon { font-size: 3rem; display: block; margin-bottom: 15px; opacity: 0.5; }
.empty-text { color: var(--text-muted); font-size: 0.95rem; }

/* Bottom Nav */
.bottom-nav {
    position: fixed; bottom: 0; left: 0; right: 0;
    display: flex; justify-content: space-around; padding: 10px 5px 20px;
    border-top: 1px solid var(--border-glass); z-index: 10;
    padding-bottom: env(safe-area-inset-bottom, 20px);
}
.nav-tab {
    background: none; border: none; color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; transition: var(--transition); flex: 1; padding: 5px;
}
.nav-tab span { font-size: 1.5rem; filter: grayscale(1); opacity: 0.7; transition: var(--transition); }
.nav-tab.active { color: var(--accent-gold); }
.nav-tab.active span { filter: grayscale(0); opacity: 1; transform: scale(1.1); }

/* Modals */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.8);
    display: flex; justify-content: center; align-items: flex-end;
    z-index: 100; opacity: 1; transition: var(--transition); backdrop-filter: blur(5px);
}
.modal[hidden] { opacity: 0; pointer-events: none; }
.modal-content {
    width: 100%; max-width: 500px; max-height: 90vh; overflow-y: auto;
    padding: 24px; border-radius: 24px 24px 0 0; position: relative;
    transform: translateY(0); transition: var(--transition);
}
.modal[hidden] .modal-content { transform: translateY(100%); }
.modal-close {
    position: absolute; top: 20px; right: 20px; background: rgba(255,255,255,0.1);
    border: none; color: #fff; width: 32px; height: 32px; border-radius: 16px;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.modal-title { font-weight: 300; margin-bottom: 10px; font-size: 1.4rem; padding-right: 40px; }

.timeline { border-left: 2px solid var(--border-glass); padding-left: 15px; margin-top: 20px; }
.timeline-event { position: relative; margin-bottom: 15px; }
.timeline-event::before {
    content: ''; position: absolute; left: -21px; top: 5px;
    width: 10px; height: 10px; border-radius: 5px; background: var(--accent-gold);
}
.event-date { font-size: 0.8rem; color: var(--text-muted); }
.event-desc { font-size: 0.95rem; }

.location-inputs { display: flex; gap: 5px; }
.location-inputs input { padding: 10px 5px; text-align: center; }

.scan-container { padding: 40px 20px; text-align: center; }
.scan-area { display: block; border: 2px dashed var(--border-glass); border-radius: var(--radius); padding: 40px 20px; cursor: pointer; }
.scan-icon { font-size: 3rem; margin-bottom: 15px; display: block; }
#scan-preview { max-width: 100%; border-radius: var(--radius-sm); margin-top: 20px; }

/* Toasts */
#toast-container { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 1000; display: flex; flex-direction: column; gap: 10px; width: 90%; max-width: 400px; }
.toast { background: var(--accent-primary); color: #fff; padding: 12px 24px; border-radius: 30px; box-shadow: 0 4px 12px rgba(0,0,0,0.3); animation: slideDown 0.3s; font-size: 0.9rem; font-weight: 500; text-align: center; }

/* Spinners */
.spinner {
    display: inline-block; width: 20px; height: 20px;
    border: 2px solid rgba(255,255,255,0.3); border-radius: 50%;
    border-top-color: #fff; animation: spin 1s ease-in-out infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideDown { from { transform: translateY(-20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
