/* ============================================
   STYLE.CSS - Design System
   Assessment Jabatan & Recruitment App
   ============================================ */

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

/* ============================================
   CSS Variables (Design Tokens)
   ============================================ */
:root {
    /* Colors */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-card-hover: rgba(255, 255, 255, 1);
    --bg-glass: rgba(255, 255, 255, 0.85);
    --bg-glass-hover: rgba(255, 255, 255, 0.95);
    --bg-input: #f1f5f9;
    --bg-input-focus: #e2e8f0;

    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --text-inverse: #ffffff;

    --border-color: #e2e8f0;
    --border-focus: rgba(99, 102, 241, 0.5);

    /* Accent colors */
    --accent-primary: #4f46e5;
    --accent-primary-hover: #6366f1;
    --accent-gradient: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #8b5cf6 100%);
    --accent-gradient-hover: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.08);
    --warning: #d97706;
    --warning-bg: rgba(217, 119, 6, 0.08);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.08);
    --info: #2563eb;
    --info-bg: rgba(37, 99, 235, 0.08);

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

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

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.06);

    /* Transitions */
    --transition-fast: 150ms ease;
    --transition-normal: 250ms ease;
    --transition-slow: 400ms ease;

    /* Font */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

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

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

body {
    font-family: var(--font-family);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Background decoration */
body::before {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 20%, rgba(99, 102, 241, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(139, 92, 246, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.02) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
    animation: bgFloat 20s ease-in-out infinite;
}

@keyframes bgFloat {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(2%, -2%) rotate(1deg); }
    66% { transform: translate(-1%, 1%) rotate(-0.5deg); }
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

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

/* ============================================
   Scrollbar
   ============================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: rgba(99, 102, 241, 0.3); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(99, 102, 241, 0.5); }

/* ============================================
   Layout
   ============================================ */
.page {
    display: none;
    position: relative;
    z-index: 1;
    min-height: 100vh;
    animation: pageIn 0.4s ease;
}
.page.active { display: block; }

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

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

/* ============================================
   Navbar
   ============================================ */
.navbar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-sm) var(--space-lg);
    align-items: center;
    justify-content: space-between;
    transition: all var(--transition-normal);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-logo {
    width: 40px;
    height: 40px;
    background: var(--accent-gradient);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 800;
    color: white;
    box-shadow: var(--shadow-glow);
}

.nav-title {
    font-size: 16px;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    gap: var(--space-xs);
    list-style: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-fast);
    border: none;
    background: none;
}
.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-glass-hover);
}
.nav-link.active {
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
}

.nav-user {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
}

.nav-user-details {
    display: flex;
    flex-direction: column;
}
.nav-user-name { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.nav-user-role { font-size: 11px; color: var(--text-muted); }

.btn-logout {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
}
.btn-logout:hover {
    background: var(--danger-bg);
    border-color: var(--danger);
    color: var(--danger);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: var(--accent-gradient-hover);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0); }

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.btn-secondary:hover {
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
}

.btn-icon {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: var(--space-sm);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.btn-icon:hover {
    background: var(--bg-glass-hover);
    color: var(--accent-primary);
    border-color: var(--accent-primary);
}
.btn-icon-danger:hover {
    color: var(--danger);
    border-color: var(--danger);
    background: var(--danger-bg);
}

.btn-loader {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
    position: relative;
}

.login-bg-decoration {
    position: absolute;
    width: 500px;
    height: 500px;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    pointer-events: none;
}
.login-bg-1 {
    top: 10%;
    left: 10%;
    background: var(--accent-primary);
    animation: float1 8s ease-in-out infinite;
}
.login-bg-2 {
    bottom: 10%;
    right: 10%;
    background: #8b5cf6;
    animation: float2 10s ease-in-out infinite;
}

@keyframes float1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(30px, -30px); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 30px); }
}

.login-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    position: relative;
    z-index: 1;
    animation: loginSlideUp 0.6s ease;
    transition: all var(--transition-slow);
}

.login-card.login-success {
    transform: scale(0.95);
    opacity: 0;
}

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

.login-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}

.login-logo {
    width: 72px;
    height: 72px;
    background: var(--accent-gradient);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--space-lg);
    font-size: 32px;
    box-shadow: var(--shadow-glow);
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { box-shadow: 0 0 30px rgba(99, 102, 241, 0.15); }
    50% { box-shadow: 0 0 50px rgba(99, 102, 241, 0.3); }
}

.login-header h1 {
    font-size: 24px;
    margin-bottom: var(--space-xs);
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required { color: var(--danger); }

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 14px;
    transition: all var(--transition-fast);
    outline: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    background: var(--bg-input-focus);
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-muted);
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-group select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.input-group {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
}
.input-group input { padding-left: 44px; }

.input-toggle {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: color var(--transition-fast);
}
.input-toggle:hover { color: var(--text-primary); }

.login-error {
    display: none;
    align-items: center;
    gap: var(--space-sm);
    padding: 12px 16px;
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-md);
    color: var(--danger);
    font-size: 13px;
    margin-bottom: var(--space-lg);
}

.shake {
    animation: shake 0.5s ease;
}
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-8px); }
    40% { transform: translateX(8px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.login-submit {
    width: 100%;
    padding: 14px;
    font-size: 15px;
}

.login-footer {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid var(--border-color);
    text-align: center;
}
.login-credentials {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.8;
}
.login-credentials code {
    background: var(--bg-glass);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    color: var(--accent-primary-hover);
}

/* ============================================
   Form Sections (Assessment)
   ============================================ */
.page-header {
    padding: var(--space-xl) 0;
}
.page-header h1 {
    font-size: 28px;
    margin-bottom: var(--space-xs);
}
.page-header p { color: var(--text-secondary); }

.assessment-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: var(--space-xl);
    padding-bottom: var(--space-3xl);
}

.form-section {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.4s ease both;
}

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

.form-section-header {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid var(--border-color);
}
.form-section-icon { font-size: 24px; }
.form-section-header h3 {
    font-size: 18px;
    flex: 1;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md) var(--space-xl);
}
.form-grid .full-width { grid-column: 1 / -1; }

/* Scoring grid */
.scoring-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.scoring-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    transition: all var(--transition-fast);
    gap: var(--space-lg);
}
.scoring-item:hover {
    border-color: var(--border-color);
    background: var(--bg-glass-hover);
}

.scoring-label { flex: 1; }
.scoring-label strong { font-size: 14px; display: block; margin-bottom: 2px; }
.scoring-label p { font-size: 12px; color: var(--text-muted); }

.scoring-buttons {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    flex-shrink: 0;
}

.score-btn {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    background: var(--bg-glass);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
}
.score-btn:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
}
.score-btn.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}
.score-btn.selected {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.4);
    transform: scale(1.1);
}

.score-label {
    font-size: 11px;
    color: var(--text-muted);
    min-width: 80px;
    text-align: center;
    font-weight: 500;
}

/* Form actions */
.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: var(--space-md);
    padding: var(--space-lg) 0;
}

/* Live score preview sidebar */
.score-preview {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.preview-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
}

.preview-card h3 {
    font-size: 16px;
    margin-bottom: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.preview-placeholder {
    color: var(--text-muted);
    text-align: center;
    padding: var(--space-xl) 0;
    font-size: 13px;
}

.preview-progress {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-lg);
    font-size: 12px;
    color: var(--text-secondary);
}
.preview-progress-bar {
    flex: 1;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    overflow: hidden;
}
.preview-progress-fill {
    height: 100%;
    background: var(--accent-gradient);
    border-radius: 2px;
    transition: width var(--transition-normal);
}

.preview-score {
    font-size: 48px;
    font-weight: 800;
    text-align: center;
    line-height: 1;
    margin-bottom: var(--space-sm);
}

.preview-recommendation {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: var(--space-xl);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid var(--border-color);
}

.preview-category {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    font-size: 12px;
    color: var(--text-secondary);
}
.preview-category span:first-child { flex: 1; }
.preview-cat-bar {
    width: 80px;
    height: 4px;
    background: var(--bg-glass);
    border-radius: 2px;
    overflow: hidden;
}
.preview-cat-fill {
    height: 100%;
    border-radius: 2px;
    transition: width var(--transition-normal);
}
.preview-cat-score { min-width: 32px; text-align: right; font-weight: 600; }

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--radius-full);
    font-size: 11px;
    font-weight: 600;
}
.badge-info {
    background: var(--info-bg);
    color: var(--info);
}
.badge-recommendation {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    border-radius: var(--radius-full);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

/* ============================================
   Dashboard
   ============================================ */
.dashboard-content {
    padding-bottom: var(--space-3xl);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-md);
    transition: all var(--transition-normal);
    animation: fadeInUp 0.4s ease both;
}
.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }
.stat-card:nth-child(5) { animation-delay: 0.2s; }

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(99, 102, 241, 0.3);
    box-shadow: var(--shadow-glow);
}

.stat-icon {
    font-size: 28px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-md);
    flex-shrink: 0;
}

.stat-total .stat-icon { background: var(--info-bg); }
.stat-success .stat-icon { background: var(--success-bg); }
.stat-warning .stat-icon { background: var(--warning-bg); }
.stat-danger .stat-icon { background: var(--danger-bg); }
.stat-avg .stat-icon { background: rgba(139, 92, 246, 0.12); }

.stat-info {
    display: flex;
    flex-direction: column;
}
.stat-value {
    font-size: 28px;
    font-weight: 800;
    line-height: 1;
}
.stat-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Table container */
.table-container {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    animation: fadeInUp 0.4s ease 0.25s both;
}

.table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-lg) var(--space-xl);
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: var(--space-md);
}

.table-header-left {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.table-header h3 { font-size: 16px; }

.table-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 4px 10px;
    border-radius: var(--radius-full);
}

.table-filters {
    display: flex;
    gap: var(--space-md);
}

.table-search {
    position: relative;
}
.table-search input {
    padding: 8px 14px 8px 36px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 13px;
    width: 260px;
    outline: none;
    transition: all var(--transition-fast);
}
.table-search input:focus {
    border-color: var(--border-focus);
    background: var(--bg-input-focus);
}
.table-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
}

.table-filter-select {
    padding: 8px 32px 8px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 13px;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
}
.table-filter-select option {
    background: var(--bg-secondary);
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
}
.data-table th {
    padding: 14px var(--space-lg);
    text-align: left;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    background: #f1f5f9;
}
.data-table td {
    padding: 14px var(--space-lg);
    font-size: 13px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.table-row {
    transition: all var(--transition-fast);
    animation: fadeInUp 0.3s ease both;
}
.table-row:hover {
    background: var(--bg-glass-hover);
}

.table-id {
    font-family: 'Courier New', monospace;
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg-glass);
    padding: 3px 8px;
    border-radius: 4px;
}

.table-candidate strong { display: block; font-size: 14px; }
.table-candidate span { font-size: 12px; color: var(--text-muted); }

.table-score { font-weight: 700; font-size: 15px; }

.table-actions {
    display: flex;
    gap: var(--space-xs);
}

.table-empty {
    text-align: center;
    padding: var(--space-3xl) !important;
}
.empty-state { color: var(--text-muted); }
.empty-icon { font-size: 48px; display: block; margin-bottom: var(--space-md); }

/* ============================================
   Detail Page
   ============================================ */
.detail-content {
    max-width: 900px;
    margin: 0 auto;
    padding-bottom: var(--space-3xl);
}

.detail-header-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-xl);
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.4s ease both;
}

.detail-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--space-xl);
}

.detail-id {
    font-family: monospace;
    font-size: 12px;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.12);
    padding: 4px 10px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: var(--space-sm);
}

.detail-name { font-size: 28px; margin-bottom: var(--space-xs); }
.detail-subtitle { color: var(--text-secondary); font-size: 14px; }

.detail-score-circle {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: var(--bg-glass);
}
.detail-score-value { font-size: 28px; font-weight: 800; line-height: 1; }
.detail-score-label { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-md);
}
.detail-meta-item {
    padding: var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
}
.detail-meta-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 4px;
}
.detail-meta-value { font-size: 14px; font-weight: 600; }

.detail-recommendation {
    border-radius: var(--radius-lg);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-lg);
    border: 1px solid;
    animation: fadeInUp 0.4s ease 0.1s both;
}

.detail-rec-header {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}
.detail-rec-icon { font-size: 28px; flex-shrink: 0; }
.detail-rec-header strong { font-size: 16px; display: block; margin-bottom: 4px; }
.detail-rec-header p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.detail-section-title {
    font-size: 18px;
    margin-bottom: var(--space-lg);
}

.detail-categories {
    margin-bottom: var(--space-lg);
    animation: fadeInUp 0.4s ease 0.2s both;
}

.detail-category-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-md);
}

.detail-cat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}
.detail-cat-header > div {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}
.detail-cat-icon { font-size: 20px; }
.detail-cat-score { font-size: 22px; font-weight: 800; }

.detail-cat-bar {
    height: 6px;
    background: var(--bg-glass);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: var(--space-lg);
}
.detail-cat-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.8s ease;
}

.detail-items { display: flex; flex-direction: column; gap: var(--space-sm); }

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
}
.detail-item-name { font-size: 14px; font-weight: 600; display: block; }
.detail-item-desc { font-size: 12px; color: var(--text-muted); }

.detail-item-score {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    flex-shrink: 0;
}
.detail-stars { display: flex; gap: 2px; }
.star { font-size: 16px; color: var(--text-muted); opacity: 0.3; }
.star.active { opacity: 1; }
.detail-item-label { font-size: 12px; color: var(--text-secondary); min-width: 80px; text-align: right; }

.detail-notes {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    animation: fadeInUp 0.4s ease 0.3s both;
}
.detail-notes-content {
    background: var(--bg-glass);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    line-height: 1.8;
    font-size: 14px;
    border-left: 3px solid var(--accent-primary);
}

.detail-actions {
    display: flex;
    justify-content: space-between;
    animation: fadeInUp 0.4s ease 0.4s both;
}

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: var(--space-lg);
}
.modal-overlay.active { display: flex; }

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-xl);
    padding: var(--space-2xl);
    max-width: 500px;
    width: 100%;
    animation: modalIn 0.3s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-result-header {
    text-align: center;
    margin-bottom: var(--space-xl);
}
.modal-result-icon { font-size: 48px; margin-bottom: var(--space-md); }
.modal-result-header h2 { font-size: 22px; margin-bottom: var(--space-sm); }
.modal-result-id {
    font-family: monospace;
    font-size: 13px;
    color: var(--accent-primary);
    background: rgba(99, 102, 241, 0.1);
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
}

.modal-result-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-lg);
    background: var(--bg-glass);
    border-radius: var(--radius-md);
    margin-bottom: var(--space-lg);
}
.modal-result-candidate h3 { font-size: 16px; margin-bottom: 4px; }
.modal-result-candidate p { font-size: 13px; color: var(--text-secondary); }

.modal-result-score {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    border: 3px solid;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.modal-score-value { font-size: 22px; font-weight: 800; line-height: 1; }
.modal-score-label { font-size: 10px; color: var(--text-muted); }

.modal-result-recommendation {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    border: 1px solid;
    margin-bottom: var(--space-xl);
}
.modal-result-recommendation strong { display: block; margin-bottom: 4px; font-size: 14px; }
.modal-result-recommendation p { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }

.modal-result-actions {
    display: flex;
    gap: var(--space-md);
    justify-content: flex-end;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: var(--space-lg);
    right: var(--space-lg);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    padding: 14px 20px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.3s ease;
    min-width: 300px;
}

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

.toast-icon { font-size: 18px; }
.toast-message { flex: 1; font-size: 13px; }
.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}
.toast-close:hover { color: var(--text-primary); }

.toast-exit { animation: toastOut 0.3s ease forwards; }

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

/* ============================================
   Print Styles
   ============================================ */
.print-view {
    display: none;
}

@media print {
    /* Hide everything except print view */
    body {
        background: white !important;
        color: #1a1a1a !important;
    }

    body::before { display: none !important; }

    .navbar,
    .page,
    .toast-container,
    .modal-overlay {
        display: none !important;
    }

    .print-view {
        display: block !important;
    }

    .print-header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding-bottom: 16px;
    }

    .print-header h1 {
        font-size: 20px;
        color: #1a1a1a;
        margin-bottom: 4px;
    }
    .print-header h2 {
        font-size: 14px;
        color: #666;
        font-weight: 400;
    }

    .print-id {
        text-align: right;
        font-size: 12px;
        color: #666;
    }
    .print-id p { margin-bottom: 2px; }

    .print-divider {
        border: none;
        border-top: 2px solid #333;
        margin: 8px 0 20px;
    }

    .print-section {
        margin-bottom: 20px;
        page-break-inside: avoid;
    }

    .print-section h3 {
        font-size: 14px;
        color: #1a1a1a;
        padding: 6px 0;
        border-bottom: 1px solid #ddd;
        margin-bottom: 10px;
    }

    .print-section h4 {
        font-size: 12px;
        color: #444;
        margin: 12px 0 6px;
    }

    .print-table-info {
        width: 100%;
        font-size: 13px;
    }
    .print-table-info td {
        padding: 4px 0;
        vertical-align: top;
    }

    .print-table {
        width: 100%;
        border-collapse: collapse;
        font-size: 12px;
        margin-bottom: 12px;
    }
    .print-table th,
    .print-table td {
        padding: 8px 10px;
        border: 1px solid #ddd;
        text-align: left;
    }
    .print-table th {
        background: #f5f5f5 !important;
        font-weight: 600;
        color: #333;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-total-row {
        background: #f0f0f0 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-total-row td { font-weight: 700 !important; }

    .print-table-small { font-size: 11px; }
    .print-table-small td, .print-table-small th { padding: 5px 8px; }

    .print-recommendation {
        padding: 12px 16px;
        border: 2px solid #333;
        border-radius: 6px;
    }
    .print-rec-title {
        font-size: 16px;
        font-weight: 700;
        margin-bottom: 6px;
    }
    .print-recommendation p { font-size: 13px; line-height: 1.6; }

    .print-notes {
        padding: 12px 16px;
        border-left: 3px solid #666;
        background: #f9f9f9 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    .print-notes p { font-size: 13px; line-height: 1.8; }

    .print-footer {
        margin-top: 40px;
        page-break-inside: avoid;
    }
    .print-signature {
        display: flex;
        justify-content: space-between;
        padding: 0 40px;
    }
    .print-sign-box {
        text-align: center;
        font-size: 13px;
    }
    .print-sign-line { margin-bottom: 4px; }
    .print-generated {
        text-align: center;
        font-size: 10px;
        color: #999;
        margin-top: 20px;
    }
}

/* ============================================
   Responsive Design
   ============================================ */
@media (max-width: 1024px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .assessment-layout {
        grid-template-columns: 1fr;
    }

    .score-preview {
        position: static;
        order: -1;
    }

    .detail-meta-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
        gap: var(--space-sm);
        padding: var(--space-sm) var(--space-md);
    }

    .nav-links {
        width: 100%;
        justify-content: center;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .scoring-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .scoring-buttons { width: 100%; justify-content: space-between; }

    .table-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .table-filters {
        width: 100%;
        flex-direction: column;
    }
    .table-search input { width: 100%; }

    .data-table { font-size: 12px; }
    .data-table th, .data-table td { padding: 10px 12px; }

    .detail-header-top {
        flex-direction: column;
        gap: var(--space-lg);
    }

    .detail-meta-grid {
        grid-template-columns: 1fr;
    }

    .detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: var(--space-sm);
    }

    .detail-actions {
        flex-direction: column;
    }
    .detail-actions .btn { width: 100%; justify-content: center; }

    .modal-content { padding: var(--space-xl); }

    .login-card { padding: var(--space-xl); }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 var(--space-md);
    }

    .page-header h1 { font-size: 22px; }

    /* Hide some table columns on mobile */
    .data-table .hide-mobile { display: none; }
}

/* ============================================
   Extra Quiz / CBT Styling Rules
   ============================================ */
.pulse-animation {
    animation: textRedPulse 1s ease infinite alternate;
}

@keyframes textRedPulse {
    from { text-shadow: 0 0 4px rgba(239, 68, 68, 0.2); transform: scale(1); }
    to { text-shadow: 0 0 12px rgba(239, 68, 68, 0.6); transform: scale(1.05); }
}

.quiz-option-card:hover {
    border-color: rgba(99, 102, 241, 0.4) !important;
    background: rgba(255, 255, 255, 0.06) !important;
}

.quiz-option-card.selected:hover {
    border-color: var(--accent-primary) !important;
    background: rgba(99, 102, 241, 0.12) !important;
}

