/* ====================================================
   Campus Connect — Design System v2
   Refined dark theme · Purple × Cyan palette
   Handcrafted for a human feel
   ==================================================== */

/* ── Google Fonts ─────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Outfit:wght@400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

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

/* ── Design Tokens ────────────────────────────────── */
:root {
    /* Backgrounds — slightly warmer than pure black */
    --bg:           #060910;
    --surface:      #0e1219;
    --surface-2:    #161c26;
    --surface-3:    #1c2433;

    /* Borders */
    --border:       #1e2530;
    --border-hover: #2d3748;

    /* Text */
    --text:         #eaf0f8;
    --text-muted:   #7d8fa3;
    --text-dim:     #3d4f63;

    /* Primary — Indigo-Purple (more refined than pure violet) */
    --primary:        #7c3aed;
    --primary-light:  #a78bfa;
    --primary-dark:   #5b21b6;
    --primary-bg:     rgba(124, 58, 237, 0.1);
    --primary-border: rgba(124, 58, 237, 0.3);
    --primary-glow:   rgba(124, 58, 237, 0.2);

    /* Accent — Teal-Cyan */
    --accent:        #06b6d4;
    --accent-light:  #67e8f9;
    --accent-bg:     rgba(6, 182, 212, 0.08);
    --accent-border: rgba(6, 182, 212, 0.28);

    /* Semantic */
    --green:        #10b981;
    --green-bg:     rgba(16, 185, 129, 0.1);
    --green-border: rgba(16, 185, 129, 0.28);

    --red:          #f43f5e;
    --red-bg:       rgba(244, 63, 94, 0.1);
    --red-border:   rgba(244, 63, 94, 0.25);

    --amber:        #f59e0b;
    --amber-bg:     rgba(245, 158, 11, 0.1);
    --amber-border: rgba(245, 158, 11, 0.28);

    --blue:         #3b82f6;
    --blue-bg:      rgba(59, 130, 246, 0.1);
    --blue-border:  rgba(59, 130, 246, 0.25);

    /* Radius */
    --radius-sm:    4px;
    --radius:       8px;
    --radius-lg:    12px;
    --radius-xl:    16px;
    --radius-2xl:   20px;
    --radius-full:  9999px;

    /* Fonts */
    --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;

    /* Shadows */
    --shadow-sm:   0 1px 3px rgba(0,0,0,0.5), 0 1px 2px rgba(0,0,0,0.4);
    --shadow:      0 4px 16px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.3);
    --shadow-lg:   0 16px 48px rgba(0,0,0,0.5), 0 4px 16px rgba(0,0,0,0.3);
    --shadow-glow: 0 0 0 1px var(--primary-border), 0 0 28px rgba(124,58,237,0.12);

    /* Transitions */
    --ease:         cubic-bezier(0.16, 1, 0.3, 1);
    --ease-fast:    cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Base ─────────────────────────────────────────── */
html {
    scroll-behavior: smooth;
    font-size: 15px;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.7;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Subtle background texture */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    left: -15%;
    width: 70%;
    height: 70%;
    background: radial-gradient(ellipse, rgba(124,58,237,0.06) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
    will-change: transform;
}

body::after {
    content: '';
    position: fixed;
    bottom: -25%;
    right: -15%;
    width: 55%;
    height: 55%;
    background: radial-gradient(ellipse, rgba(6,182,212,0.04) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}

.page-content {
    flex: 1;
    position: relative;
    z-index: 1;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── Scrollbar ────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: rgba(124,58,237,0.25);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(124,58,237,0.45);
}

::selection {
    background: rgba(124,58,237,0.22);
    color: #c4b5fd;
}

/* ── Container ────────────────────────────────────── */
.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ── Divider ──────────────────────────────────────── */
.divider {
    height: 1px;
    background: var(--border);
    border: none;
    margin: 0;
}

/* ── Surface cards ────────────────────────────────── */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: border-color 0.2s var(--ease);
}

.card:hover {
    border-color: var(--border-hover);
}

.card-body { padding: 1.5rem; }

/* Glassmorphism card */
.glass-card {
    background: rgba(14, 18, 25, 0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(124, 58, 237, 0.14);
    border-radius: var(--radius-xl);
}

/* ── Buttons ──────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s var(--ease);
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    position: relative;
    letter-spacing: -0.01em;
}

.btn i { font-size: 0.85em; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 0 rgba(124,58,237,0);
}
.btn-primary:hover {
    background: #6d28d9;
    border-color: #6d28d9;
    color: #fff;
    box-shadow: 0 0 24px rgba(124,58,237,0.45), 0 0 8px rgba(124,58,237,0.3);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-accent {
    background: var(--accent);
    color: #020d14;
    border-color: var(--accent);
    font-weight: 700;
}
.btn-accent:hover {
    background: #0891b2;
    border-color: #0891b2;
    color: #020d14;
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(6,182,212,0.4);
}

.btn-secondary {
    background: var(--surface-2);
    color: var(--text-muted);
    border-color: var(--border);
}
.btn-secondary:hover {
    border-color: var(--primary-border);
    color: var(--text);
    background: var(--surface-3);
}

.btn-danger {
    background: var(--red-bg);
    color: var(--red);
    border-color: var(--red-border);
}
.btn-danger:hover {
    background: rgba(244, 63, 94, 0.18);
    color: var(--red);
    border-color: var(--red);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border-color: transparent;
}
.btn-ghost:hover {
    color: var(--text);
    background: var(--surface-2);
    border-color: var(--border);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-light);
    border-color: var(--primary-border);
}
.btn-outline-primary:hover {
    background: var(--primary-bg);
    color: var(--primary-light);
    border-color: rgba(124,58,237,0.5);
    transform: translateY(-1px);
}

.btn-sm  { padding: 0.28rem 0.65rem; font-size: 0.79rem; gap: 0.3rem; }
.btn-lg  { padding: 0.7rem 1.5rem; font-size: 0.95rem; border-radius: var(--radius-lg); }
.btn-xl  { padding: 0.85rem 1.85rem; font-size: 1.05rem; border-radius: var(--radius-lg); gap: 0.5rem; }

/* ── Form controls ────────────────────────────────── */
.form-label {
    display: block;
    font-size: 0.83rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.38rem;
    letter-spacing: -0.01em;
}

.form-sublabel {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 0.3rem;
    line-height: 1.5;
}

.form-control,
.form-select {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.58rem 0.9rem;
    color: var(--text);
    font-size: 0.875rem;
    font-family: var(--font);
    width: 100%;
    outline: none;
    transition: border-color 0.18s, box-shadow 0.18s;
    -webkit-appearance: none;
    appearance: none;
    line-height: 1.5;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(124,58,237,0.6);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: var(--surface-2);
    color: var(--text);
}

.form-control::placeholder { color: var(--text-dim); }
.form-select option { background: var(--surface-2); color: var(--text); }

textarea.form-control {
    resize: vertical;
    min-height: 120px;
    line-height: 1.65;
}

/* ── Badge ────────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 0.71rem;
    font-weight: 700;
    border: 1px solid transparent;
    letter-spacing: 0.2px;
    line-height: 1.6;
}

.badge-primary { background: var(--primary-bg); color: var(--primary-light); border-color: var(--primary-border); }
.badge-accent  { background: var(--accent-bg); color: var(--accent-light); border-color: var(--accent-border); }
.badge-green   { background: var(--green-bg); color: var(--green); border-color: var(--green-border); }
.badge-red     { background: var(--red-bg); color: var(--red); border-color: var(--red-border); }
.badge-amber   { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-border); }
.badge-blue    { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-border); }
.badge-muted   { background: var(--surface-2); color: var(--text-muted); border-color: var(--border); }

/* ── Page transition ──────────────────────────────── */
.page-content {
    animation: pageIn 0.22s var(--ease);
}

@keyframes pageIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0%, 100% { box-shadow: 0 0 20px rgba(124,58,237,0.2); }
    50%       { box-shadow: 0 0 36px rgba(124,58,237,0.5); }
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-10px); }
}

@keyframes shimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(20px) scale(0.96); }
    to   { opacity: 1; transform: translateX(0) scale(1); }
}

/* ── Gradient text ────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ── Focus visible ────────────────────────────────── */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 4px;
}

/* Make Bootstrap forms work with our theme */
.form-control:focus,
.form-select:focus,
.btn:focus {
    box-shadow: 0 0 0 3px var(--primary-glow) !important;
    outline: none;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(124,58,237,0.6) !important;
    background-color: var(--surface-2) !important;
    color: var(--text) !important;
}

/* ── Skill tags ───────────────────────────────────── */
.skill-tag {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    background: var(--primary-bg);
    color: #b8a4fa;
    border: 1px solid var(--primary-border);
    border-radius: var(--radius-full);
    font-size: 0.71rem;
    font-weight: 600;
    letter-spacing: 0.1px;
    transition: all 0.18s;
}

.skill-tag:hover {
    background: rgba(124,58,237,0.18);
    border-color: rgba(124,58,237,0.45);
}

/* ── Section eyebrow ──────────────────────────────── */
.section-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--primary-light);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* ── Upvote button ────────────────────────────────── */
.upvote-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.28rem;
    padding: 0.28rem 0.6rem;
    border-radius: var(--radius);
    font-size: 0.79rem;
    font-weight: 600;
    background: var(--surface-2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.18s var(--ease);
    font-family: var(--font);
    letter-spacing: -0.01em;
}

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

.upvote-btn:active {
    transform: translateY(0);
}

.upvote-btn.upvoted {
    background: var(--primary-bg);
    color: var(--primary-light);
    border-color: var(--primary-border);
}

/* ── Loading spinner ──────────────────────────────── */
.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}

/* ── Utility helpers ──────────────────────────────── */
.text-muted  { color: var(--text-muted); }
.text-dim    { color: var(--text-dim); }
.text-primary { color: var(--primary-light); }
.text-green  { color: var(--green); }
.text-red    { color: var(--red); }
.text-amber  { color: var(--amber); }

.mono { font-family: var(--font-mono); }

.truncate {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ── Smooth link transitions ──────────────────────── */
a {
    transition: color 0.15s;
}

/* ── Bootstrap dark overrides ─────────────────────── */
.form-control,
.form-select {
    color: var(--text);
    background-color: var(--surface-2);
    border-color: var(--border);
}
