/*
 * VeloVanier Design System
 * Aligned with CSC Vanier (cscvanier.com) visual identity
 * Liquid Glass Aesthetic — frosted panels, soft depth
 * Navy + white institutional palette, community-focused
 */

/* ═══════════════════════════════════════════════
   FONTS — DM Sans (clean geometric, close to CSC's system sans)
   + Fraunces for display headings
   ═══════════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,300;0,9..144,500;0,9..144,700;1,9..144,400&display=swap');

/* ═══════════════════════════════════════════════
   CSS VARIABLES — Palette aligned with CSC Vanier
   ═══════════════════════════════════════════════ */
:root {
    /* Core palette — CSC Vanier institutional white + navy */
    --vv-bg: #f7f8fa;
    --vv-bg-warm: #f0f1f4;
    --vv-surface: rgba(255, 255, 255, 0.6);
    --vv-surface-hover: rgba(255, 255, 255, 0.78);
    --vv-surface-solid: #ffffff;
    --vv-glass: rgba(255, 255, 255, 0.4);
    --vv-glass-border: rgba(28, 36, 75, 0.08);
    --vv-glass-strong: rgba(255, 255, 255, 0.65);

    /* Brand — CSC Vanier navy #1c244b */
    --vv-green: #1c244b;
    --vv-green-soft: #2d3a6e;
    --vv-green-muted: rgba(28, 36, 75, 0.1);
    --vv-green-pale: #e8eaf2;
    --vv-sage: #4a5280;
    --vv-olive: #32373c;

    /* Accents */
    --vv-amber: #c7853b;
    --vv-amber-soft: rgba(199, 133, 59, 0.1);
    --vv-coral: #c25b4e;
    --vv-coral-soft: rgba(194, 91, 78, 0.1);
    --vv-blue: #1c244b;
    --vv-blue-soft: rgba(28, 36, 75, 0.08);

    /* Text — CSC Vanier charcoal #32373c */
    --vv-text: #32373c;
    --vv-text-secondary: #5a5f66;
    --vv-text-muted: #8c9099;
    --vv-text-inverse: #ffffff;

    /* Borders & shadows */
    --vv-border: rgba(0, 0, 0, 0.06);
    --vv-border-strong: rgba(0, 0, 0, 0.1);
    --vv-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.03);
    --vv-shadow: 0 4px 16px rgba(0, 0, 0, 0.06), 0 1px 4px rgba(0, 0, 0, 0.04);
    --vv-shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    --vv-shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.5);

    /* Radius */
    --vv-radius-sm: 10px;
    --vv-radius: 16px;
    --vv-radius-lg: 24px;
    --vv-radius-xl: 32px;
    --vv-radius-full: 9999px;

    /* Spacing */
    --vv-space-xs: 4px;
    --vv-space-sm: 8px;
    --vv-space-md: 16px;
    --vv-space-lg: 24px;
    --vv-space-xl: 40px;
    --vv-space-2xl: 64px;

    /* Transitions */
    --vv-ease: cubic-bezier(0.4, 0, 0.2, 1);
    --vv-ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --vv-duration: 0.2s;
    --vv-duration-slow: 0.4s;

    /* Typography */
    --vv-font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --vv-font-display: 'Fraunces', Georgia, serif;
    --vv-leading: 1.6;
    --vv-tracking: -0.01em;
}

/* ═══════════════════════════════════════════════
   RESET & BASE
   ═══════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--vv-font);
    color: var(--vv-text);
    background: var(--vv-bg);
    line-height: var(--vv-leading);
    letter-spacing: var(--vv-tracking);
    min-height: 100vh;
}

/* Subtle texture on body — very light, cool */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ═══════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--vv-font-display);
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--vv-text);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--vv-green);
    text-decoration: none;
    transition: color var(--vv-duration) var(--vv-ease);
}
a:hover { color: var(--vv-green-soft); }

small, .text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.text-muted { color: var(--vv-text-muted) !important; }
.text-secondary { color: var(--vv-text-secondary) !important; }
.text-green { color: var(--vv-green) !important; }
.text-amber { color: var(--vv-amber) !important; }
.text-coral { color: var(--vv-coral) !important; }
.font-display { font-family: var(--vv-font-display); }

/* ═══════════════════════════════════════════════
   GLASS PANELS — the core of the design
   ═══════════════════════════════════════════════ */
.glass {
    background: var(--vv-surface);
    backdrop-filter: blur(24px) saturate(1.4);
    -webkit-backdrop-filter: blur(24px) saturate(1.4);
    border: 1px solid var(--vv-glass-border);
    border-radius: var(--vv-radius);
    box-shadow: var(--vv-shadow-glass);
    transition: all var(--vv-duration) var(--vv-ease);
}

.glass:hover {
    background: var(--vv-surface-hover);
    box-shadow: var(--vv-shadow-lg);
    transform: translateY(-1px);
}

.glass-strong {
    background: var(--vv-glass-strong);
    backdrop-filter: blur(40px) saturate(1.6);
    -webkit-backdrop-filter: blur(40px) saturate(1.6);
    border: 1px solid var(--vv-glass-border);
    border-radius: var(--vv-radius);
    box-shadow: var(--vv-shadow-glass);
}

.glass-card {
    background: var(--vv-surface);
    backdrop-filter: blur(20px) saturate(1.3);
    -webkit-backdrop-filter: blur(20px) saturate(1.3);
    border: 1px solid var(--vv-glass-border);
    border-radius: var(--vv-radius-lg);
    box-shadow: var(--vv-shadow);
    padding: var(--vv-space-lg);
    transition: all var(--vv-duration-slow) var(--vv-ease);
}

.glass-card:hover {
    background: var(--vv-surface-hover);
    box-shadow: var(--vv-shadow-lg);
    transform: translateY(-2px);
}

/* ═══════════════════════════════════════════════
   LAYOUT CONTAINERS
   ═══════════════════════════════════════════════ */
.vv-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--vv-space-lg);
    position: relative;
    z-index: 1;
}

.vv-narrow { max-width: 520px; }
.vv-medium { max-width: 800px; }

.vv-grid {
    display: grid;
    gap: var(--vv-space-lg);
}
.vv-grid-2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.vv-grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.vv-grid-4 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.vv-stack { display: flex; flex-direction: column; gap: var(--vv-space-md); }
.vv-row { display: flex; align-items: center; gap: var(--vv-space-md); }
.vv-between { justify-content: space-between; }
.vv-center { justify-content: center; align-items: center; }

/* ═══════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════ */
.vv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    font-family: var(--vv-font);
    font-size: 0.9375rem;
    font-weight: 500;
    border: none;
    border-radius: var(--vv-radius-full);
    cursor: pointer;
    transition: all var(--vv-duration) var(--vv-ease);
    text-decoration: none;
    line-height: 1;
    white-space: nowrap;
}

.vv-btn-primary {
    background: var(--vv-green);
    color: var(--vv-text-inverse);
    box-shadow: 0 2px 8px rgba(28, 36, 75, 0.2);
}
.vv-btn-primary:hover {
    background: var(--vv-green-soft);
    color: var(--vv-text-inverse);
    box-shadow: 0 4px 16px rgba(28, 36, 75, 0.25);
    transform: translateY(-1px);
}

.vv-btn-secondary {
    background: var(--vv-surface);
    color: var(--vv-text);
    border: 1px solid var(--vv-border-strong);
    backdrop-filter: blur(12px);
}
.vv-btn-secondary:hover {
    background: var(--vv-surface-hover);
    border-color: var(--vv-green);
    color: var(--vv-green);
}

.vv-btn-ghost {
    background: transparent;
    color: var(--vv-text-secondary);
    padding: 10px 20px;
}
.vv-btn-ghost:hover {
    background: var(--vv-glass);
    color: var(--vv-text);
}

.vv-btn-danger {
    background: var(--vv-coral);
    color: var(--vv-text-inverse);
}
.vv-btn-danger:hover {
    background: #b34a3e;
    color: var(--vv-text-inverse);
}

.vv-btn-sm { padding: 8px 18px; font-size: 0.8125rem; }
.vv-btn-lg { padding: 16px 36px; font-size: 1.0625rem; }
.vv-btn-icon { padding: 10px; border-radius: var(--vv-radius); }

/* ═══════════════════════════════════════════════
   FORM INPUTS — rounded, soft, glass-backed
   ═══════════════════════════════════════════════ */
.vv-input,
.vv-select,
.vv-textarea {
    width: 100%;
    padding: 14px 20px;
    font-family: var(--vv-font);
    font-size: 0.9375rem;
    color: var(--vv-text);
    background: var(--vv-surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--vv-border);
    border-radius: var(--vv-radius);
    outline: none;
    transition: all var(--vv-duration) var(--vv-ease);
}

.vv-input:focus,
.vv-select:focus,
.vv-textarea:focus {
    border-color: var(--vv-green);
    background: var(--vv-surface-hover);
    box-shadow: 0 0 0 3px var(--vv-green-muted);
}

.vv-input::placeholder { color: var(--vv-text-muted); }
.vv-textarea { resize: vertical; min-height: 100px; }
.vv-select { appearance: none; cursor: pointer; }

.vv-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--vv-text-secondary);
    margin-bottom: 6px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.vv-field { margin-bottom: var(--vv-space-lg); }

.vv-input-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--vv-space-md);
}

/* ═══════════════════════════════════════════════
   BADGES & CHIPS
   ═══════════════════════════════════════════════ */
.vv-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--vv-radius-full);
    letter-spacing: 0.02em;
}

.vv-badge-green { background: var(--vv-green-muted); color: var(--vv-green); }
.vv-badge-amber { background: var(--vv-amber-soft); color: var(--vv-amber); }
.vv-badge-coral { background: var(--vv-coral-soft); color: var(--vv-coral); }
.vv-badge-blue { background: var(--vv-blue-soft); color: var(--vv-blue); }
.vv-badge-muted { background: rgba(0,0,0,0.05); color: var(--vv-text-muted); }

/* ═══════════════════════════════════════════════
   TABLES — clean, minimal
   ═══════════════════════════════════════════════ */
.vv-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}
.vv-table th {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--vv-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--vv-border);
}
.vv-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--vv-border);
    vertical-align: middle;
}
.vv-table tbody tr {
    transition: background var(--vv-duration) var(--vv-ease);
}
.vv-table tbody tr:hover {
    background: var(--vv-glass);
}

/* ═══════════════════════════════════════════════
   STAT CARDS (KPI)
   ═══════════════════════════════════════════════ */
.vv-stat {
    padding: var(--vv-space-lg);
}
.vv-stat-value {
    font-family: var(--vv-font-display);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1;
    letter-spacing: -0.03em;
}
.vv-stat-label {
    font-size: 0.8125rem;
    color: var(--vv-text-muted);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 500;
}
.vv-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--vv-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* ═══════════════════════════════════════════════
   NAVIGATION — Portal header
   ═══════════════════════════════════════════════ */
.vv-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    padding: var(--vv-space-md) 0;
    background: rgba(244, 241, 236, 0.8);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border-bottom: 1px solid var(--vv-border);
}

.vv-nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--vv-space-lg);
}

.vv-logo {
    font-family: var(--vv-font-display);
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--vv-green);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vv-logo-mark {
    width: 36px;
    height: 36px;
    background: var(--vv-green);
    border-radius: var(--vv-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.125rem;
}

.vv-nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
}

.vv-nav-link {
    padding: 8px 16px;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--vv-text-secondary);
    border-radius: var(--vv-radius-sm);
    transition: all var(--vv-duration) var(--vv-ease);
    text-decoration: none;
}
.vv-nav-link:hover,
.vv-nav-link.active {
    color: var(--vv-green);
    background: var(--vv-green-muted);
}

/* ═══════════════════════════════════════════════
   SIDEBAR — Staff dashboard
   ═══════════════════════════════════════════════ */
.vv-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: #1c244b;
    border-right: none;
    padding: var(--vv-space-lg);
    overflow-y: auto;
    z-index: 50;
    display: flex;
    flex-direction: column;
    color: rgba(255, 255, 255, 0.8);
}

.vv-sidebar-logo {
    padding-bottom: var(--vv-space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: var(--vv-space-lg);
}

.vv-sidebar .vv-logo { color: #ffffff; }
.vv-sidebar .vv-logo-mark { background: #ffffff; color: #1c244b; }

.vv-sidebar-section {
    margin-bottom: var(--vv-space-md);
}

.vv-sidebar-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin-bottom: 6px;
}

.vv-sidebar-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.7);
    border-radius: var(--vv-radius-sm);
    transition: all var(--vv-duration) var(--vv-ease);
    text-decoration: none;
}
.vv-sidebar-link:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}
.vv-sidebar-link.active {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.15);
    font-weight: 600;
}

.vv-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
}

.vv-sidebar-link i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.7;
}

.vv-main-with-sidebar {
    margin-left: 260px;
    min-height: 100vh;
    padding: var(--vv-space-xl);
}

/* ═══════════════════════════════════════════════
   ALERTS / TOASTS
   ═══════════════════════════════════════════════ */
.vv-alert {
    padding: var(--vv-space-md) var(--vv-space-lg);
    border-radius: var(--vv-radius);
    font-size: 0.9375rem;
    display: flex;
    align-items: center;
    gap: 12px;
}
.vv-alert-success { background: var(--vv-green-muted); color: var(--vv-green); border: 1px solid rgba(58,125,68,0.15); }
.vv-alert-warning { background: var(--vv-amber-soft); color: var(--vv-amber); border: 1px solid rgba(199,133,59,0.15); }
.vv-alert-danger { background: var(--vv-coral-soft); color: var(--vv-coral); border: 1px solid rgba(194,91,78,0.15); }
.vv-alert-info { background: var(--vv-blue-soft); color: var(--vv-blue); border: 1px solid rgba(74,127,165,0.15); }

/* ═══════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════ */
.vv-page-header {
    margin-bottom: var(--vv-space-xl);
}
.vv-page-title {
    font-family: var(--vv-font-display);
    font-size: 2rem;
    font-weight: 500;
    letter-spacing: -0.03em;
}
.vv-page-subtitle {
    color: var(--vv-text-muted);
    font-size: 0.9375rem;
    margin-top: 4px;
}

.vv-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--vv-text-muted);
    margin-bottom: var(--vv-space-sm);
}
.vv-breadcrumb a { color: var(--vv-text-secondary); }
.vv-breadcrumb a:hover { color: var(--vv-green); }
.vv-breadcrumb-sep { opacity: 0.4; }

/* ═══════════════════════════════════════════════
   EMPTY STATES
   ═══════════════════════════════════════════════ */
.vv-empty {
    text-align: center;
    padding: var(--vv-space-2xl) var(--vv-space-xl);
    color: var(--vv-text-muted);
}
.vv-empty-icon { font-size: 3rem; margin-bottom: var(--vv-space-md); opacity: 0.4; }
.vv-empty-title { font-family: var(--vv-font-display); font-size: 1.25rem; color: var(--vv-text-secondary); }

/* ═══════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════ */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.vv-animate {
    animation: fadeInUp 0.5s var(--vv-ease) both;
}
.vv-animate-delay-1 { animation-delay: 0.05s; }
.vv-animate-delay-2 { animation-delay: 0.1s; }
.vv-animate-delay-3 { animation-delay: 0.15s; }
.vv-animate-delay-4 { animation-delay: 0.2s; }

/* ═══════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    :root {
        --vv-space-lg: 16px;
        --vv-space-xl: 24px;
    }
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }
    .vv-sidebar { display: none; }
    .vv-main-with-sidebar { margin-left: 0; padding: var(--vv-space-lg); }
    .vv-input-group { grid-template-columns: 1fr; }
    .vv-nav-links { display: none; }
}

/* ═══════════════════════════════════════════════
   UTILITIES
   ═══════════════════════════════════════════════ */
.vv-mt-sm { margin-top: var(--vv-space-sm); }
.vv-mt-md { margin-top: var(--vv-space-md); }
.vv-mt-lg { margin-top: var(--vv-space-lg); }
.vv-mt-xl { margin-top: var(--vv-space-xl); }
.vv-mb-md { margin-bottom: var(--vv-space-md); }
.vv-mb-lg { margin-bottom: var(--vv-space-lg); }
.vv-p-lg { padding: var(--vv-space-lg); }
.vv-p-xl { padding: var(--vv-space-xl); }
.vv-gap-sm { gap: var(--vv-space-sm); }
.vv-gap-md { gap: var(--vv-space-md); }
.vv-w-full { width: 100%; }
.vv-text-center { text-align: center; }
.vv-text-right { text-align: right; }
.vv-hidden { display: none !important; }
.vv-flex { display: flex; }
.vv-flex-wrap { flex-wrap: wrap; }
.vv-items-center { align-items: center; }
.vv-justify-between { justify-content: space-between; }
.vv-grow { flex: 1; }
.vv-shrink-0 { flex-shrink: 0; }
