/* ============================================
   InterviewIQ Demo — Shared Stylesheet
   Inherits visual identity from the recruiter portal
   ============================================ */

/* --------------------------------------------
   Design Tokens
   -------------------------------------------- */
:root {
    /* Brand */
    --teal-deep: #0d4f4f;
    --teal-primary: #147373;
    --teal-light: #1a9393;
    --teal-pale: #e6f5f5;

    --orange-primary: #e86c2c;
    --orange-bright: #ff7a3d;
    --orange-pale: #fff5f0;

    /* Neutrals */
    --cream: #fdfbf7;
    --charcoal: #1a1a1a;
    --gray-dark: #3d3d3d;
    --gray-mid: #6b6b6b;
    --gray-light: #a3a3a3;
    --gray-lighter: #e5e5e5;
    --gray-bg: #f7f5f0;
    --white: #ffffff;

    /* Status */
    --green: #22c55e;
    --green-light: #dcfce7;
    --green-text: #14532d;
    --blue: #3b82f6;
    --blue-light: #dbeafe;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --red: #ef4444;
    --red-light: #fee2e2;
    --red-text: #7f1d1d;
    --yellow: #f59e0b;
    --yellow-light: #fef3c7;
    --yellow-text: #78350f;

    /* Spacing */
    --space-xs: 8px;
    --space-sm: 16px;
    --space-md: 24px;
    --space-lg: 32px;
    --space-xl: 48px;
    --space-2xl: 64px;

    /* Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-full: 9999px;

    /* Shadows */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.10);
    --shadow-xl: 0 30px 80px rgba(0, 0, 0, 0.12);

    /* Motion */
    --t-fast: 0.15s ease;
    --t-base: 0.25s ease;
    --t-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --sidebar-w: 260px;
    --header-h: 72px;
    --content-max: 1280px;
}

/* --------------------------------------------
   Reset & Base
   -------------------------------------------- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'DM Serif Display', Georgia, serif;
    font-weight: 400;
    line-height: 1.2;
    color: var(--teal-deep);
}

h1 { font-size: 2.5rem; letter-spacing: -0.01em; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; font-family: 'Outfit', sans-serif; font-weight: 600; }

a { color: var(--teal-primary); text-decoration: none; transition: color var(--t-fast); }
a:hover { color: var(--teal-deep); }

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

input, textarea, select {
    font-family: inherit;
    font-size: 1rem;
}

/* --------------------------------------------
   App Shell (sidebar + main)
   -------------------------------------------- */
.app {
    display: grid;
    grid-template-columns: var(--sidebar-w) 1fr;
    min-height: 100vh;
}

.sidebar {
    background: var(--teal-deep);
    color: var(--white);
    padding: var(--space-md) 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.brand {
    padding: 0 var(--space-md) var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: var(--space-md);
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-bright));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'DM Serif Display', serif;
    color: var(--white);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.brand-name {
    font-family: 'DM Serif Display', serif;
    font-size: 1.4rem;
    color: var(--white);
}

.brand-tag {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.nav { padding: 0 var(--space-sm); flex: 1; }
.nav-section {
    font-size: 0.7rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
    padding: var(--space-md) var(--space-sm) var(--space-xs);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    color: rgba(255, 255, 255, 0.75);
    font-size: 0.95rem;
    transition: all var(--t-fast);
    margin-bottom: 2px;
    cursor: pointer;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--white);
}

.nav-item.active {
    background: var(--teal-primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-item .icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    position: relative;
}

.nav-item.disabled::after {
    content: 'Demo';
    position: absolute;
    right: 12px;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
}

.user-pill {
    margin: var(--space-sm);
    padding: 12px;
    background: rgba(255, 255, 255, 0.06);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 10px;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--orange-primary), var(--orange-bright));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-name { font-size: 0.875rem; color: var(--white); font-weight: 500; }
.user-role { font-size: 0.7rem; color: rgba(255, 255, 255, 0.5); }

/* --------------------------------------------
   Main content
   -------------------------------------------- */
.main {
    background: var(--cream);
    min-height: 100vh;
    overflow-x: hidden;
}

.topbar {
    height: var(--header-h);
    background: var(--white);
    border-bottom: 1px solid var(--gray-lighter);
    padding: 0 var(--space-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
}

.topbar-left { display: flex; align-items: center; gap: var(--space-md); }
.crumb {
    font-size: 0.875rem;
    color: var(--gray-mid);
}

.crumb strong { color: var(--charcoal); font-weight: 500; }

.topbar-right { display: flex; align-items: center; gap: var(--space-sm); }

.demo-badge {
    background: var(--orange-pale);
    color: var(--orange-primary);
    padding: 6px 12px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.content {
    padding: var(--space-lg);
    max-width: var(--content-max);
    margin: 0 auto;
}

.page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
    gap: var(--space-md);
    flex-wrap: wrap;
}

.page-head h1 { margin-bottom: 4px; }
.page-head .subtitle {
    color: var(--gray-mid);
    font-size: 1rem;
}

/* --------------------------------------------
   Buttons
   -------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--t-fast);
    line-height: 1;
    border: 1px solid transparent;
}

.btn-primary {
    background: var(--teal-primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--teal-deep);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--white);
    color: var(--charcoal);
    border-color: var(--gray-lighter);
}
.btn-secondary:hover {
    border-color: var(--gray-light);
    background: var(--gray-bg);
}

.btn-accent {
    background: var(--orange-primary);
    color: var(--white);
}
.btn-accent:hover { background: var(--orange-bright); transform: translateY(-1px); }

.btn-ghost {
    color: var(--teal-primary);
    background: transparent;
}
.btn-ghost:hover { background: var(--teal-pale); }

.btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }

/* --------------------------------------------
   Cards
   -------------------------------------------- */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-lighter);
    overflow: hidden;
}

.card-pad { padding: var(--space-md); }

.card-header {
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--gray-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.card-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--charcoal);
    font-family: 'Outfit', sans-serif;
}

/* --------------------------------------------
   Badges (status pills)
   -------------------------------------------- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
}

.badge-open { background: var(--green-light); color: var(--green-text); }
.badge-hold { background: var(--yellow-light); color: var(--yellow-text); }
.badge-draft { background: var(--gray-bg); color: var(--gray-mid); }
.badge-closed { background: var(--red-light); color: var(--red-text); }
.badge-info { background: var(--blue-light); color: #1e3a8a; }
.badge-purple { background: var(--purple-light); color: #5b21b6; }

.badge-strong-hire { background: var(--green-light); color: var(--green-text); }
.badge-hire { background: #d1fae5; color: var(--green-text); }
.badge-consider { background: var(--yellow-light); color: var(--yellow-text); }
.badge-no-hire { background: var(--red-light); color: var(--red-text); }

/* --------------------------------------------
   Tables (jobs list, comparison etc.)
   -------------------------------------------- */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--white);
}

.table thead th {
    text-align: left;
    padding: 14px var(--space-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--gray-mid);
    background: var(--gray-bg);
    border-bottom: 1px solid var(--gray-lighter);
}

.table tbody td {
    padding: 16px var(--space-md);
    border-bottom: 1px solid var(--gray-lighter);
    font-size: 0.95rem;
    vertical-align: middle;
}

.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr.clickable { cursor: pointer; transition: background var(--t-fast); }
.table tbody tr.clickable:hover { background: var(--teal-pale); }
.table tbody tr.disabled { opacity: 0.55; }
.table tbody tr.disabled td { cursor: not-allowed; }

.role-cell {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.role-title { font-weight: 600; color: var(--charcoal); }
.role-dept { font-size: 0.8rem; color: var(--gray-mid); }

.metric-cell {
    font-variant-numeric: tabular-nums;
    color: var(--charcoal);
    font-weight: 500;
}
.metric-sub { font-size: 0.75rem; color: var(--gray-mid); font-weight: 400; }

/* --------------------------------------------
   Stats (dashboard tiles)
   -------------------------------------------- */
.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
}

.stat {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    border: 1px solid var(--gray-lighter);
    position: relative;
    overflow: hidden;
}

.stat::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--teal-primary);
}

.stat.accent::before { background: var(--orange-primary); }
.stat.warn::before { background: var(--yellow); }
.stat.success::before { background: var(--green); }

.stat-label {
    font-size: 0.8rem;
    color: var(--gray-mid);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    margin-bottom: 8px;
}

.stat-value {
    font-family: 'DM Serif Display', serif;
    font-size: 2.4rem;
    color: var(--teal-deep);
    line-height: 1;
}

.stat-delta {
    font-size: 0.8rem;
    color: var(--gray-mid);
    margin-top: 8px;
}

.stat-delta strong { color: var(--green); font-weight: 600; }
.stat-delta.down strong { color: var(--red); }

/* --------------------------------------------
   Mobile gate (for complex screens)
   -------------------------------------------- */
.mobile-gate {
    display: none;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    min-height: 80vh;
    align-items: center;
    justify-content: center;
}

.mobile-gate-inner {
    max-width: 360px;
}

.mobile-gate svg {
    width: 64px;
    height: 64px;
    margin: 0 auto var(--space-md);
    color: var(--teal-primary);
}

.mobile-gate h2 {
    margin-bottom: var(--space-sm);
}

.mobile-gate p {
    color: var(--gray-mid);
    margin-bottom: var(--space-md);
}

@media (max-width: 900px) {
    .desktop-only .mobile-gate { display: flex; }
    .desktop-only .desktop-content { display: none; }
}

/* --------------------------------------------
   Mobile responsive (general)
   -------------------------------------------- */
@media (max-width: 900px) {
    .app {
        grid-template-columns: 1fr;
    }
    .sidebar {
        position: fixed;
        left: -100%;
        width: 280px;
        z-index: 100;
        transition: left var(--t-base);
    }
    .sidebar.open { left: 0; }
    .topbar {
        padding: 0 var(--space-md);
    }
    .content {
        padding: var(--space-md);
    }
    h1 { font-size: 1.875rem; }
    h2 { font-size: 1.5rem; }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .mobile-menu-btn { display: inline-flex; }
}

@media (max-width: 600px) {
    .stat-grid { grid-template-columns: 1fr; }
    .table thead { display: none; }
    .table tbody td { display: block; padding: 8px var(--space-md); border: none; }
    .table tbody tr { display: block; border-bottom: 1px solid var(--gray-lighter); padding: var(--space-sm) 0; }
    .table tbody tr:last-child { border-bottom: none; }
}

.mobile-menu-btn {
    display: none;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    align-items: center;
    justify-content: center;
    color: var(--charcoal);
    background: var(--gray-bg);
}

.mobile-menu-btn:hover { background: var(--gray-lighter); }

/* --------------------------------------------
   Banner (for demo notice)
   -------------------------------------------- */
.demo-banner {
    background: linear-gradient(90deg, var(--teal-deep), var(--teal-primary));
    color: var(--white);
    padding: 8px var(--space-md);
    font-size: 0.8rem;
    text-align: center;
    letter-spacing: 0.02em;
}

.demo-banner strong { font-weight: 600; color: #ffd6b3; }

/* --------------------------------------------
   Utility
   -------------------------------------------- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.text-mid { color: var(--gray-mid); }
.text-sm { font-size: 0.875rem; }
.text-xs { font-size: 0.75rem; }
.font-mono { font-variant-numeric: tabular-nums; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mt-md { margin-top: var(--space-md); }

/* Subtle entry animation */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeInUp 0.5s var(--t-smooth) both;
}

.fade-in-stagger > * {
    animation: fadeInUp 0.5s var(--t-smooth) both;
}
.fade-in-stagger > *:nth-child(1) { animation-delay: 0.05s; }
.fade-in-stagger > *:nth-child(2) { animation-delay: 0.10s; }
.fade-in-stagger > *:nth-child(3) { animation-delay: 0.15s; }
.fade-in-stagger > *:nth-child(4) { animation-delay: 0.20s; }
.fade-in-stagger > *:nth-child(5) { animation-delay: 0.25s; }
.fade-in-stagger > *:nth-child(6) { animation-delay: 0.30s; }
.fade-in-stagger > *:nth-child(7) { animation-delay: 0.35s; }
.fade-in-stagger > *:nth-child(8) { animation-delay: 0.40s; }
