/* assets/css/style.css */
/* Premium CSS Design System - Glassmorphism, Light-Theme & Micro-Animations */

:root {
    --bg-main: #fcfaf8;
    --bg-gradient: linear-gradient(135deg, #fefdfb 0%, #f7f3f0 100%);
    --surface: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.9);
    --border: #ffdce4; /* PrimaryColor2 (Light Pink) */
    --border-hover: rgba(77, 4, 21, 0.35); /* PrimaryColor1 with transparency */
    
    --text-primary: #3d2327; /* Dark maroon-tinted slate */
    --text-secondary: #705559; /* Medium maroon-tinted grey */
    --text-muted: #9e8589;
    
    --accent-primary: #4d0415; /* PrimaryColor1 (Deep Maroon) */
    --accent-primary-glow: rgba(77, 4, 21, 0.15);
    --accent-secondary: #d8ac56; /* SecondaryColor1 (Gold/Ochre) */
    --accent-secondary-light: #ffeece; /* SecondaryColor2 (Soft Cream) */
    
    --color-safe: #10b981;
    --color-safe-glow: rgba(16, 185, 129, 0.15);
    --color-warn: #f59e0b;
    --color-warn-glow: rgba(245, 158, 11, 0.15);
    --color-danger: #ef4444;
    --color-danger-glow: rgba(239, 68, 68, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow: 0 12px 34px rgba(77, 4, 21, 0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 1. Global Resets & Typography */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Montserrat', sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--accent-primary);
}

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

a:hover {
    color: var(--accent-secondary);
}

/* 2. Layout Elements */
.app-header {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(77, 4, 21, 0.02);
}

.header-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 18px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 14px;
}

.brand-text {
    display: flex;
    flex-direction: column;
    text-align: left;
}

.brand-name {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    font-size: 16px;
    letter-spacing: 0.02em;
    color: var(--accent-primary);
}

.brand-sub {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-link {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
}

.nav-link:hover, .nav-link.active {
    color: var(--accent-primary);
    background: var(--accent-secondary-light);
}

.portal-badge {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 6px 16px;
    border-radius: 99px;
    box-shadow: 0 4px 12px rgba(77, 4, 21, 0.2);
}

.app-main {
    flex: 1;
    display: flex;
    align-items: stretch;
    padding: 40px 24px;
}

.main-container {
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.app-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.6);
}

.footer-container p {
    font-size: 12px;
    color: var(--text-muted);
}

/* 3. Cards & Glassmorphism */
.glass-card {
    background: var(--surface-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 30px;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 16px 40px rgba(77, 4, 21, 0.08);
}

/* 4. Dashboard KPIs */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 35px;
}

.kpi-card {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
}

.kpi-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: #ffffff;
    border: 1px solid var(--border);
}

.kpi-icon.blue { background: var(--accent-secondary-light); border-color: var(--border); color: var(--accent-primary); }
.kpi-icon.green { background: rgba(16, 185, 129, 0.08); border-color: rgba(16, 185, 129, 0.2); color: #10b981; }
.kpi-icon.yellow { background: rgba(245, 158, 11, 0.08); border-color: rgba(245, 158, 11, 0.2); color: #f59e0b; }
.kpi-icon.red { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.2); color: #ef4444; }

.kpi-body {
    display: flex;
    flex-direction: column;
}

.kpi-title {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.kpi-val {
    font-size: 32px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-top: 2px;
    line-height: 1;
}

/* 5. Buttons & Forms */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 99px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 14px rgba(77, 4, 21, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(77, 4, 21, 0.45);
    background: #62061b;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid var(--border);
    color: var(--accent-primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: var(--accent-secondary-light);
    box-shadow: none;
    border-color: var(--accent-secondary);
}

.btn-success {
    background: var(--color-safe);
    box-shadow: 0 4px 14px var(--color-safe-glow);
}

.btn-success:hover {
    background: #059669;
    box-shadow: 0 6px 20px var(--color-safe-glow);
}

.btn-danger {
    background: var(--color-danger);
    box-shadow: 0 4px 14px var(--color-danger-glow);
}

.btn-danger:hover {
    background: #dc2626;
    box-shadow: 0 6px 20px var(--color-danger-glow);
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    color: var(--text-primary);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(77, 4, 21, 0.15);
}

/* 6. Leaderboard / Data Tables */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}

.app-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.app-table th {
    background: var(--accent-secondary-light);
    padding: 16px 20px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 2px solid var(--border);
}

.app-table td {
    padding: 18px 20px;
    font-size: 14px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
    background: #ffffff;
}

.app-table tr:last-child td {
    border-bottom: none;
}

.app-table tr:hover td {
    background: #fffcfd;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-green { background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); color: #059669; }
.badge-yellow { background: rgba(245, 158, 11, 0.08); border: 1px solid rgba(245, 158, 11, 0.25); color: #d97706; }
.badge-red { background: rgba(239, 68, 68, 0.08); border: 1px solid rgba(239, 68, 68, 0.25); color: #dc2626; }
.badge-blue { background: rgba(77, 4, 21, 0.06); border: 1px solid rgba(77, 4, 21, 0.2); color: var(--accent-primary); }

/* 7. CBT Multi-Pillar Test Wizard Grid */
.cbt-grid {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    align-items: start;
}

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

.cbt-side-panel {
    position: sticky;
    top: 100px;
}

.cbt-timer-box {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: var(--accent-secondary-light);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

.cbt-timer-label {
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.cbt-timer-val {
    font-family: 'Outfit', sans-serif;
    font-size: 38px;
    font-weight: 800;
    color: var(--accent-primary);
    margin-top: 4px;
    letter-spacing: 0.02em;
}

.pillar-progress-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.pillar-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    background: #ffffff;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    transition: var(--transition);
    text-align: left;
}

.pillar-item.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.pillar-item.completed {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
    color: #059669;
}

.pillar-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-muted);
}

.pillar-item.active .pillar-dot { background: #ffffff; box-shadow: 0 0 8px #ffffff; }
.pillar-item.completed .pillar-dot { background: var(--color-safe); }

/* Question Layout */
.q-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.q-badge {
    background: var(--accent-secondary-light);
    border: 1px solid var(--border);
    padding: 6px 14px;
    border-radius: 99px;
    font-size: 11px;
    font-weight: 800;
    color: var(--accent-primary);
}

.q-text {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 30px;
    text-align: left;
}

/* MCQ Options */
.mcq-options-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 35px;
}

.option-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
}

.option-card:hover {
    background: var(--accent-secondary-light);
    border-color: var(--accent-secondary);
}

.option-card.selected {
    background: var(--accent-secondary-light);
    border-color: var(--accent-primary);
    box-shadow: 0 0 15px rgba(77, 4, 21, 0.08);
}

.option-marker {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    color: var(--text-secondary);
    transition: var(--transition);
}

.option-card.selected .option-marker {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

.option-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

/* Kraepelin Grid style */
.kraepelin-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    border: 2px dashed var(--border);
    border-radius: var(--radius-md);
    margin-bottom: 30px;
    background: #ffffff;
}

.kraepelin-sum {
    font-family: 'Outfit', sans-serif;
    font-size: 54px;
    font-weight: 800;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
}

.kraepelin-input-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 320px;
    margin-top: 30px;
}

.kraepelin-btn {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--accent-primary);
    font-size: 20px;
    font-weight: 800;
    padding: 15px 0;
    cursor: pointer;
    transition: var(--transition);
}

.kraepelin-btn:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
}

/* Essay Text Area */
.essay-textarea {
    min-height: 240px;
    resize: vertical;
    line-height: 1.7;
    background: #ffffff;
}

/* 8. HRD Candidate Detail Grid */
.candidate-detail-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 30px;
    align-items: start;
}

@media (max-width: 992px) {
    .candidate-detail-grid {
        grid-template-columns: 1fr;
    }
}

.radar-chart-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.radar-container {
    width: 100%;
    max-width: 280px;
    margin: 20px auto;
}

.metrics-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
    margin-top: 20px;
    text-align: left;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
    padding-bottom: 10px;
}

.metric-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
}

.metric-value {
    font-weight: 800;
    font-size: 13px;
    color: var(--accent-primary);
}

/* AI Prompt Box Center */
.prompt-box-card {
    margin-top: 30px;
}

.prompt-textarea {
    width: 100%;
    height: 150px;
    background: #fdfbf9;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 12px;
    padding: 16px;
    color: #4a2800;
    margin: 15px 0;
    resize: none;
}

.section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* 9. Printable Report layout overrides */
@media print {
    body {
        background: white !important;
        color: black !important;
        font-size: 12pt;
    }

    .app-header, .app-footer, .btn, .prompt-box-card {
        display: none !important;
    }

    .app-main {
        padding: 0 !important;
    }

    .glass-card {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        padding: 0 !important;
        color: black !important;
    }

    .candidate-detail-grid {
        grid-template-columns: 250px 1fr !important;
        gap: 20px !important;
        color: black !important;
    }

    .metric-value, .metric-label, .q-text, .option-text, td, th {
        color: black !important;
    }

    .badge {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: transparent !important;
    }
}
