/* ============================================
   PribadiNotes — Dark Mode Theme
   Colors: #0d0d0d, #1a1a1a, #2a2a2a, #3a3a3a
   Accents: #182551 (navy), #BA9A42 (gold)

   base.css — CSS variables, reset, buttons, forms, login screen.
   Part of the app.css split (see assets/css/*.css, loaded in index.php
   in cascade-safe order — this file must load FIRST).
   ============================================ */

:root {
    --bg-darkest: #0d0d0d;
    --bg-dark: #141414;
    --bg-card: #1a1a1a;
    --bg-elevated: #222222;
    --bg-hover: #2a2a2a;
    --bg-active: #333333;
    --border: #2a2a2a;
    --border-light: #3a3a3a;

    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-inverse: #0d0d0d;

    --navy: #182551;
    --navy-light: #1e3070;
    --navy-glow: rgba(24, 37, 81, 0.3);
    --gold: #BA9A42;
    --gold-light: #d4b04e;
    --gold-dim: rgba(186, 154, 66, 0.15);
    --gold-glow: rgba(186, 154, 66, 0.3);

    --danger: #e74c3c;
    --danger-dim: rgba(231, 76, 60, 0.15);
    --success: #2ecc71;
    --info: #3498db;

    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;
    --radius-xl: 20px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.5);

    --sidebar-width: 280px;
    --sidebar-collapsed-width: 76px;
    --toolbar-height: 56px;
    --transition: 0.2s ease;

    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

html { font-size: 15px; -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font);
    background: var(--bg-darkest);
    color: var(--text-primary);
    line-height: 1.6;
    overflow: hidden;
    height: 100vh;
    width: 100vw;
}

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

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

::selection { background: var(--gold-dim); color: var(--gold-light); }

.hidden { display: none !important; }

/* ===== Buttons ===== */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: var(--radius);
    border: none; cursor: pointer; font-family: var(--font);
    font-size: 0.9rem; font-weight: 500;
    transition: all var(--transition);
    white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn i { font-size: 1.1rem; }

.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-light); box-shadow: 0 0 20px var(--navy-glow); }

.btn-gold { background: var(--gold); color: var(--text-inverse); }
.btn-gold:hover { background: var(--gold-light); box-shadow: 0 0 20px var(--gold-glow); }

.btn-outline { background: transparent; color: var(--text-secondary); border: 1px solid var(--border-light); }
.btn-outline:hover { background: var(--bg-hover); color: var(--text-primary); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #c0392b; }

.btn-block { width: 100%; justify-content: center; }
.btn-icon {
    width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
    border: none; background: transparent; color: var(--text-secondary);
    border-radius: var(--radius-sm); cursor: pointer; transition: all var(--transition);
    flex-shrink: 0;
}
.btn-icon:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn-icon.active { color: var(--gold); }
.btn-tiny { width: 26px; height: 26px; font-size: 0.85rem; }

.mt-2 { margin-top: 12px; }

/* ===== Form ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block; margin-bottom: 6px;
    font-size: 0.8rem; font-weight: 500;
    color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px;
}
.form-input, .meta-select {
    width: 100%; padding: 10px 14px;
    background: var(--bg-dark); border: 1px solid var(--border);
    border-radius: var(--radius-sm); color: var(--text-primary);
    font-family: var(--font); font-size: 0.9rem;
    transition: border-color var(--transition);
}
.form-input:focus, .meta-select:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}
.input-icon {
    position: relative;
}
.input-icon i {
    position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 1.1rem; pointer-events: none;
}
.input-icon input {
    width: 100%; padding: 12px 14px 12px 42px;
    background: var(--bg-elevated); border: 1px solid var(--border);
    border-radius: var(--radius); color: var(--text-primary);
    font-family: var(--font); font-size: 0.95rem;
    transition: all var(--transition);
}
.input-icon input:focus {
    outline: none; border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-dim);
}
.input-icon input::placeholder { color: var(--text-muted); }

.color-picker-row { display: flex; align-items: center; gap: 10px; }
.color-input {
    width: 40px; height: 40px; border: 2px solid var(--border);
    border-radius: var(--radius-sm); cursor: pointer; padding: 2px;
    background: transparent;
}
.color-hex { color: var(--text-secondary); font-family: monospace; font-size: 0.9rem; }

/* Shared "row of form groups" layout used across many feature modals */
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ===== Login Screen ===== */
.login-screen {
    position: fixed; inset: 0; z-index: 1000;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-darkest);
    background-image: radial-gradient(ellipse at 30% 50%, var(--navy-glow), transparent 60%),
                      radial-gradient(ellipse at 70% 50%, var(--gold-dim), transparent 60%);
}
.login-container {
    width: 100%; max-width: 400px; padding: 40px;
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
}
.login-brand {
    text-align: center; margin-bottom: 32px;
}
.login-logo {
    width: 64px; height: 64px; margin: 0 auto 16px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--navy), var(--gold));
    border-radius: 16px; font-size: 1.8rem; color: #fff;
}
.login-brand h1 {
    font-size: 1.6rem; font-weight: 700; color: var(--text-primary);
}
.login-brand p {
    color: var(--text-muted); font-size: 0.9rem; margin-top: 4px;
}
.login-error {
    margin-top: 14px; padding: 10px 14px;
    background: var(--danger-dim); color: var(--danger);
    border-radius: var(--radius-sm); font-size: 0.85rem; text-align: center;
}

/* ===== App Layout ===== */
.app {
    display: flex; height: 100vh; width: 100vw; overflow: hidden;
}

@media (max-width: 480px) {
    .login-container { padding: 24px; margin: 12px; }
}
