/* ============================================================
   Vault CSS — Consolidated RPGAnywhere Site
   Maps vault CSS variables to RPA design tokens.
   The RPA compiled CSS (/css/style.css) is loaded first in
   header.php, so all Tailwind utilities are already available.
   ============================================================ */

/* === CSS VARIABLES (vault pages use these) === */
:root {
    --bg-dark:       #06131c;   /* rpa-bg */
    --bg-darker:     #040d14;
    --bg-card:       #0d2030;   /* rpa-surface */
    --bg-card-hover: #112838;   /* rpa-raised */

    --primary:       oklch(44% 0.10 199);   /* rpa-primary */
    --primary-light: oklch(56% 0.12 196);   /* rpa-primary-light */
    --primary-dark:  oklch(32% 0.08 199);   /* rpa-primary-dark */
    --accent:        oklch(77% 0.14 194);   /* rpa-accent */

    --text-primary:   #e0eef0;  /* rpa-text */
    --text-secondary: #7a9fac;  /* rpa-text-muted */
    --text-muted:     #4a6a78;  /* rpa-text-dim */

    --border:       #1e3d4f;    /* rpa-border */
    --border-light: #2a5060;

    --success: #4caf50;
    --warning: #ff9800;
    --danger:  #f44336;
    --info:    #4eccd0;

    --glow:        0 0 20px oklch(44% 0.10 199 / 0.3);
    --glow-strong: 0 0 30px oklch(44% 0.10 199 / 0.5);
    --shadow:      0 4px 6px rgba(0,0,0,0.3);
    --shadow-lg:   0 8px 16px rgba(0,0,0,0.4);

    --sidebar-width: 260px;

    --font-primary: 'Inter', system-ui, sans-serif;
    --font-mono:    'Courier New', monospace;
}

/* === VAULT LAYOUT === */
.vault-layout {
    display: flex;
    min-height: calc(100vh - 64px); /* below IH top nav */
    margin-top: 64px;               /* IH nav height */
}

/* === VAULT SIDEBAR === */
.vault-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-darker);
    border-right: 1px solid var(--border);
    position: fixed;
    top: 64px;  /* below IH nav */
    height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 50;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.vault-sidebar::-webkit-scrollbar       { width: 4px; }
.vault-sidebar::-webkit-scrollbar-track { background: transparent; }
.vault-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.vault-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-darker);
    z-index: 1;
}

.vault-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--accent);
    font-weight: 600;
    font-size: 1.1rem;
}

/* === VAULT MAIN CONTENT === */
.vault-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-width: 0;
    padding: 0;
}

.vault-main.full-width {
    margin-left: 0;
}

/* === VAULT CONTENT HEADER === */
.vault-content-header {
    padding: 1.5rem 2rem 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg-darker);
}

.vault-content-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
}

.vault-content-description {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.vault-breadcrumb {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    padding-bottom: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.vault-breadcrumb a   { color: var(--primary-light); text-decoration: none; }
.vault-breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep       { color: var(--text-muted); }

.vault-content-body {
    padding: 1.5rem 2rem;
}

/* === VAULT SIDEBAR NAVIGATION === */
.vault-sidebar-nav { padding: 0.5rem 0; }

.vault-nav-section { margin-bottom: 0.25rem; }

.vault-nav-section-title {
    padding: 0.5rem 1rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.vault-nav-items {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vault-nav-item { margin: 0; }

.vault-nav-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    border-radius: 0;
    transition: background 0.15s, color 0.15s;
    border-left: 3px solid transparent;
}

.vault-nav-link:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-left-color: var(--primary-light);
}

.vault-nav-link.active {
    background: oklch(44% 0.10 199 / 0.15);
    color: var(--primary-light);
    border-left-color: var(--primary);
    font-weight: 600;
}

.vault-nav-link.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.vault-nav-icon  { flex-shrink: 0; width: 1.25rem; text-align: center; }
.vault-nav-label { flex: 1; }

.vault-nav-badge {
    font-size: 0.65rem;
    padding: 0.125rem 0.375rem;
    border-radius: 9999px;
    background: var(--primary);
    color: #fff;
    font-weight: 600;
}

.vault-nav-badge-soon { background: var(--text-muted); }

.vault-nav-children .vault-nav-link {
    padding-left: 2rem;
    font-size: 0.8rem;
}

/* === VAULT SIDEBAR TOGGLE (mobile) === */
.vault-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 200;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    align-items: center;
    justify-content: center;
}

/* === VAULT FOOTER === */
.vault-footer {
    background: var(--bg-darker);
    border-top: 1px solid var(--border);
    padding: 1rem 2rem;
    margin-top: 2rem;
}

.vault-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* === VAULT GENERATOR COMPONENTS === */
.generator-section {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.generator-section h2,
.generator-section h3 {
    color: var(--accent);
    margin-bottom: 1rem;
}

.btn, button.generate-btn, input[type="submit"] {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s;
    font-family: var(--font-primary);
}

.btn:hover, button.generate-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

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

.btn-secondary:hover {
    border-color: var(--primary-light);
    color: var(--primary-light);
    background: var(--bg-card);
    transform: translateY(-1px);
}

/* Result/output cards */
.result-card, .output-card, .generated-result {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-top: 1rem;
}

.result-card h3, .output-card h3 { color: var(--primary-light); }
.result-card p,  .output-card p  { color: var(--text-secondary); }

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.875rem;
}

th {
    background: var(--bg-card);
    color: var(--primary-light);
    padding: 0.625rem 1rem;
    text-align: left;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
}

td {
    padding: 0.5rem 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

tr:last-child td { border-bottom: none; }
tr:hover td      { background: var(--bg-card-hover); }

/* Forms */
input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    color: var(--text-primary);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    font-family: var(--font-primary);
    transition: border-color 0.15s;
    width: 100%;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px oklch(44% 0.10 199 / 0.2);
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.375rem;
}

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

/* === MOBILE === */
@media (max-width: 768px) {
    .vault-layout { margin-top: 56px; }

    .vault-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        top: 56px;
        height: calc(100vh - 56px);
    }

    .vault-sidebar.active { transform: translateX(0); }

    .vault-main { margin-left: 0; }

    .vault-sidebar-toggle { display: flex; }

    .vault-footer-inner { flex-direction: column; text-align: center; }
}
