/* ============================================================
   VAKF Shared Stylesheet
   Dark-mode design system for all pages
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────────────────────── */
:root {
    --primary:          #2980b9;
    --primary-hover:    #1c5980;
    --primary-glow:     rgba(41, 128, 185, 0.35);
    --accent:           #3498db;
    --success:          #27ae60;
    --warning:          #f39c12;
    --danger:           #e74c3c;
    --danger-hover:     #c0392b;

    /* Backgrounds */
    --bg-page:          #0b1120;
    --bg-card:          #111827;
    --bg-card-hover:    #162033;
    --bg-input:         #1a2235;
    --bg-nav:           rgba(11, 17, 32, 0.92);

    /* Borders */
    --border:           rgba(255,255,255,0.08);
    --border-focus:     var(--primary);

    /* Text */
    --text:             #e2e8f0;
    --text-muted:       #94a3b8;
    --text-dim:         #64748b;

    /* Misc */
    --radius:           14px;
    --radius-sm:        8px;
    --shadow:           0 8px 32px rgba(0,0,0,0.5);
    --shadow-sm:        0 4px 16px rgba(0,0,0,0.3);
    --transition:       0.25s ease;

    /* Nav height */
    --nav-h:            70px;
}

/* ── Reset & Base ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0; padding: 0;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-page);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
}

h1,h2,h3,h4,h5,h6 { margin: 0 0 0.5em; font-weight: 700; line-height: 1.3; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
img { display: block; }

/* ── Navigation ────────────────────────────────────────────── */
.vakf-nav {
    background: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    height: var(--nav-h);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 0 var(--border);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
}

.nav-brand img { height: 40px; transition: transform var(--transition); }
.nav-brand img:hover { transform: scale(1.06); }
.nav-brand-title { font-size: 1.15em; font-weight: 700; letter-spacing: 0.5px; }

.nav-links {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-links a, .nav-links button.nav-link {
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    font-size: 0.95em;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    border: none; background: none; cursor: pointer;
    font-family: inherit;
}

.nav-links a:hover, .nav-links a.active,
.nav-links button.nav-link:hover {
    color: white;
    background: var(--primary);
    text-decoration: none;
}

.nav-auth {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-nav-login {
    color: rgba(255,255,255,0.8) !important;
    border: 1px solid var(--border) !important;
    border-radius: var(--radius-sm) !important;
}

.btn-nav-register {
    background: var(--primary) !important;
    color: white !important;
    border-radius: var(--radius-sm) !important;
}

.btn-nav-register:hover { background: var(--primary-hover) !important; }

.nav-profile-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 12px 5px 5px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text) !important;
    text-decoration: none;
    transition: all var(--transition);
}

.nav-profile-pill:hover {
    border-color: var(--primary);
    background: var(--bg-card-hover);
    text-decoration: none;
}

.nav-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--primary);
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 0.9em; color: white;
    overflow: hidden;
}

.nav-avatar img { width: 100%; height: 100%; object-fit: cover; }

.badge-admin {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    font-size: 0.65em;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.badge-role {
    font-size: 0.72em;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.badge-role.admin { background: rgba(231,76,60,0.2); color: #e74c3c; border: 1px solid rgba(231,76,60,0.3); }
.badge-role.member { background: rgba(41,128,185,0.2); color: #3498db; border: 1px solid rgba(41,128,185,0.3); }

/* ── Page Layout ───────────────────────────────────────────── */
.page-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.page-header {
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 2em;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-header p {
    color: var(--text-muted);
    font-size: 1.05em;
    margin: 0;
}

/* ── Cards ─────────────────────────────────────────────────── */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    transition: border-color var(--transition), background var(--transition);
}

.card:hover { border-color: rgba(255,255,255,0.14); }

/* ── Forms ─────────────────────────────────────────────────── */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 0.88em;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.form-input, .form-textarea, .form-select {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 0.97em;
    padding: 12px 16px;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-textarea { resize: vertical; min-height: 120px; }
.form-select option { background: var(--bg-card); }

/* Password strength bar */
.strength-bar-wrap { margin-top: 8px; height: 4px; background: var(--border); border-radius: 4px; overflow: hidden; }
.strength-bar { height: 100%; width: 0; border-radius: 4px; transition: width 0.4s, background 0.4s; }
.strength-label { font-size: 0.78em; margin-top: 5px; color: var(--text-dim); }

/* Form error / success */
.form-error {
    background: rgba(231,76,60,0.12);
    border: 1px solid rgba(231,76,60,0.3);
    color: #f87171;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9em;
    margin-bottom: 16px;
}

.form-success {
    background: rgba(39,174,96,0.12);
    border: 1px solid rgba(39,174,96,0.3);
    color: #4ade80;
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 0.9em;
    margin-bottom: 16px;
}

/* ── Buttons ───────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.97em;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}
.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px var(--primary-glow);
    text-decoration: none;
    color: white;
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--bg-card-hover); border-color: rgba(255,255,255,0.14); text-decoration: none; color: var(--text); }

.btn-danger {
    background: rgba(231,76,60,0.15);
    color: #f87171;
    border: 1px solid rgba(231,76,60,0.3);
}
.btn-danger:hover { background: var(--danger); color: white; text-decoration: none; }

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg-input); color: var(--text); text-decoration: none; }

.btn-sm { padding: 7px 14px; font-size: 0.85em; }
.btn-lg { padding: 14px 30px; font-size: 1.05em; }
.btn-full { width: 100%; justify-content: center; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ── Avatar ────────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: linear-gradient(135deg, var(--primary), #9b59b6);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm  { width: 34px; height: 34px; font-size: 0.85em; }
.avatar-md  { width: 48px; height: 48px; font-size: 1.1em; }
.avatar-lg  { width: 72px; height: 72px; font-size: 1.5em; }
.avatar-xl  { width: 100px; height: 100px; font-size: 2em; }

/* ── Toast Notifications ───────────────────────────────────── */
#vakf-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 14px 20px;
    max-width: 320px;
    font-size: 0.9em;
    box-shadow: var(--shadow);
    animation: toastIn 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.success { border-left: 4px solid var(--success); }
.toast.error   { border-left: 4px solid var(--danger); }
.toast.info    { border-left: 4px solid var(--primary); }

@keyframes toastIn { from { opacity: 0; transform: translateX(30px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateX(30px); } }

/* ── Dividers ──────────────────────────────────────────────── */
.divider {
    border: none;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

/* ── Loading ───────────────────────────────────────────────── */
.spinner {
    width: 24px; height: 24px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 768px) {
    .vakf-nav { padding: 0 16px; }
    .nav-links a span.nav-label { display: none; }
    .page-container { padding: 24px 16px 60px; }
    .page-header h1 { font-size: 1.5em; }
}
