/* ============================================================
   Tracer Study ISTN — Main Stylesheet
   Tema: Biru (#1a3a6b), Putih, Abu Muda (#f8f9fa)
   Mobile-first, Corporate, Professional
   ============================================================ */

/* --- CSS Variables --- */
:root {
    --primary: #1a3a6b;
    --primary-dark: #122a4f;
    --primary-light: #2a5a9b;
    --secondary: #6c757d;
    --success: #28a745;
    --info: #17a2b8;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #343a40;
    --white: #ffffff;
    --bg-light: #f0f2f5;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --navbar-height: 70px;
    --border-radius: 12px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --transition: all 0.3s ease;
}

/* --- Reset & Base --- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    color: #333;
    background: var(--bg-light);
    padding-top: var(--navbar-height);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 { letter-spacing: -0.01em; }
a { transition: var(--transition); }
a:hover { opacity: 0.85; }

/* --- Navbar --- */
.navbar {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    padding: 0.75rem 0;
    min-height: var(--navbar-height);
}
.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}
.navbar .nav-link {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    margin: 0 0.125rem;
    font-weight: 500;
    font-size: 0.9rem;
    transition: var(--transition);
}
.navbar .nav-link:hover,
.navbar .nav-link.active {
    background: rgba(255,255,255,0.12);
}
.navbar .nav-link.active { font-weight: 600; }

/* --- Hero Section --- */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, #0d2137 100%);
    min-height: 85vh;
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}
.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(255,255,255,0.03);
    border-radius: 50%;
    pointer-events: none;
}

/* --- Section Padding --- */
.section-padding { padding: 5rem 0; }
@media (max-width: 768px) { .section-padding { padding: 3rem 0; } }

/* --- Feature Cards --- */
.feature-card {
    border-radius: var(--border-radius);
    transition: var(--transition);
}
.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg) !important;
}
.feature-icon { font-size: 2.5rem; }

/* --- Step Cards --- */
.step-number {
    width: 56px;
    height: 56px;
    line-height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(26,58,107,0.3);
}
.step-card { padding: 1.5rem; }

/* --- Footer --- */
.footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: rgba(255,255,255,0.85);
}
.footer a:hover {
    color: var(--warning) !important;
}

/* --- Flash Messages --- */
.flash-container {
    position: fixed;
    top: calc(var(--navbar-height) + 10px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 600px;
}
.alert {
    border: none;
    border-radius: 10px;
}

/* --- Cards --- */
.card {
    border-radius: var(--border-radius);
    border: none;
}
.card-header {
    border-radius: var(--border-radius) var(--border-radius) 0 0 !important;
}

/* --- Buttons --- */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: var(--transition);
}
.btn-lg { border-radius: 12px; }
.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
}
.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,58,107,0.3);
}
.btn-outline-primary {
    color: var(--primary);
    border-color: var(--primary);
}
.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
}

/* --- Form Controls --- */
.form-control, .form-select {
    border-radius: 8px;
    border: 1.5px solid #dee2e6;
    padding: 0.625rem 1rem;
    font-size: 0.95rem;
    transition: var(--transition);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 0.2rem rgba(26,58,107,0.15);
}
.form-control-lg { font-size: 1rem; }
.form-label { font-weight: 500; color: #444; }
.input-group-text {
    border-radius: 8px 0 0 8px;
    background: var(--light);
    border: 1.5px solid #dee2e6;
}

/* --- Admin Sidebar --- */
.admin-wrapper { display: flex; min-height: calc(100vh - var(--navbar-height)); }
.admin-sidebar {
    width: 260px;
    background: var(--primary-dark);
    padding: 1.5rem 0;
    flex-shrink: 0;
}
.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.7);
    padding: 0.75rem 1.5rem;
    border-radius: 0;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}
.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: white;
    background: rgba(255,255,255,0.08);
    border-left-color: var(--warning);
}
.admin-content {
    flex: 1;
    padding: 2rem;
    background: var(--bg-light);
}

/* --- Dashboard Stats --- */
.stat-card {
    border-radius: var(--border-radius);
    padding: 1.5rem;
    transition: var(--transition);
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md) !important; }
.stat-icon { font-size: 2rem; opacity: 0.2; }

/* --- Charts --- */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* --- Tables --- */
.table th {
    font-weight: 600;
    color: var(--primary);
    border-top: none;
}
.table-hover tbody tr:hover {
    background: rgba(26,58,107,0.04);
}

/* --- Pagination --- */
.page-link {
    border-radius: 8px;
    margin: 0 2px;
    color: var(--primary);
    border: 1px solid #dee2e6;
}
.page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
}

/* --- Likert Table --- */
.likert-table td { vertical-align: middle; }
.likert-radio {
    text-align: center;
    padding: 0.5rem;
}
.likert-radio label {
    display: inline-block;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    border: 2px solid #dee2e6;
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}
.likert-radio input:checked + label {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.likert-radio input { display: none; }
.likert-radio label:hover {
    border-color: var(--primary-light);
    background: rgba(26,58,107,0.08);
}

/* --- Survey Steps --- */
.survey-step { display: none; }
.survey-step.active { display: block; }
.step-indicator {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}
.step-dot {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    color: #999;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin: 0 8px;
}
.step-dot.active {
    background: var(--primary);
    color: white;
}
.step-dot.completed {
    background: var(--success);
    color: white;
}

/* --- Print --- */
@media print {
    .navbar, .footer, .admin-sidebar, .btn, .no-print { display: none !important; }
    .admin-content { padding: 0 !important; }
    body { padding-top: 0 !important; }
    .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* --- Responsive Admin --- */
@media (max-width: 768px) {
    .admin-sidebar {
        width: 100%;
        position: relative;
        min-height: auto;
    }
    .admin-wrapper { flex-direction: column; }
    .admin-content { padding: 1rem; }
    .hero-section { min-height: 60vh; }
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease; }

/* --- Loading Spinner --- */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255,255,255,0.8);
    z-index: 99999;
    justify-content: center;
    align-items: center;
}
.spinner-overlay.show { display: flex; }

/* --- Wizards / Progress --- */
.progress-step {
    display: flex;
    align-items: center;
    margin-bottom: 2rem;
}
.progress-step .step {
    flex: 1;
    text-align: center;
    position: relative;
}
.progress-step .step::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e9ecef;
    z-index: 0;
}
.progress-step .step:last-child::after { display: none; }
.progress-step .step .circle {
    width: 36px;
    height: 36px;
    line-height: 36px;
    border-radius: 50%;
    background: #e9ecef;
    display: inline-block;
    position: relative;
    z-index: 1;
    font-weight: 600;
    font-size: 0.85rem;
}
.progress-step .step.active .circle {
    background: var(--primary);
    color: white;
}
.progress-step .step.completed .circle {
    background: var(--success);
    color: white;
}
