/* ==========================================================================
   SPMI Pemetaan App - Style System (Glassmorphism & Neon Glow Theme)
   ========================================================================== */

:root {
    --bg-primary: #0a0f1d;
    --bg-secondary: #131c33;
    --bg-glass: rgba(20, 30, 60, 0.45);
    --border-glass: rgba(255, 255, 255, 0.08);
    
    --accent-blue: #00d2ff;
    --accent-indigo: #7928ca;
    --accent-purple: #9b51e0;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --status-success: #10b981;
    --status-warning: #f59e0b;
    --status-error: #ef4444;
    
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-primary);
    background-image: 
        radial-gradient(at 0% 0%, rgba(0, 210, 255, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(121, 40, 202, 0.08) 0px, transparent 50%);
    font-family: var(--font-sans);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Layout Wrapper */
.app-container {
    display: grid;
    grid-template-columns: 350px 1fr;
    width: 100%;
    min-height: 100vh;
}

/* ==========================================================================
   Sidebar (Floating Dashboard)
   ========================================================================== */
.sidebar {
    background: var(--bg-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-right: 1px solid var(--border-glass);
    padding: 1.25rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    position: sticky;
    top: 0;
    height: 100vh;
    max-height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    align-self: start;
    z-index: 99;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 210, 255, 0.35) rgba(0,0,0,0.15);
}

/* Custom Scrollbar for Sidebar — WebKit */
.sidebar::-webkit-scrollbar {
    width: 5px;
}
.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.35);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 210, 255, 0.65);
}

.brand-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 20px rgba(0, 210, 255, 0.35);
}

.brand-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    background: linear-gradient(to right, var(--text-primary), var(--accent-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.select-instrument-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.form-select {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.875rem;
    outline: none;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.form-select:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.15);
}

.score-display-card {
    background: linear-gradient(135deg, rgba(20, 40, 80, 0.35), rgba(40, 20, 80, 0.35));
    border: 1px solid var(--border-glass);
    border-radius: 20px;
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    position: relative;
    overflow: hidden;
}

.score-display-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
}

.score-circle {
    width: 105px;
    height: 105px;
    border-radius: 50%;
    background: rgba(10, 15, 30, 0.6);
    border: 4px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.score-value {
    font-size: 1.85rem;
    font-weight: 900;
    color: var(--accent-blue);
    text-shadow: 0 0 15px rgba(0, 210, 255, 0.4);
    line-height: 1;
}

.score-label {
    font-size: 0.675rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

.badge-peringkat {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text-primary);
    transition: var(--transition-smooth);
    display: inline-block;
    max-width: 100%;
    word-wrap: break-word;
}

.badge-peringkat.unggul {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--status-success);
    color: #34d399;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.15);
}

.badge-peringkat.baik-sekali {
    background: rgba(59, 130, 246, 0.1);
    border-color: #3b82f6;
    color: #60a5fa;
}

.badge-peringkat.baik {
    background: rgba(245, 158, 11, 0.1);
    border-color: var(--status-warning);
    color: #fbbf24;
}

.status-threshold-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
}

.status-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 700;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.active {
    background-color: var(--status-success);
    box-shadow: 0 0 8px var(--status-success);
}

.status-dot.inactive {
    background-color: var(--status-error);
    box-shadow: 0 0 8px var(--status-error);
}

/* collapsible temuan list */
.temuan-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    text-align: left;
}

.temuan-header {
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
    border-bottom: 1px solid var(--border-glass);
}

.temuan-list {
    max-height: 250px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding: 0.5rem 0.25rem 0.5rem 0;
}

/* Custom Scrollbar for Temuan List inside card */
.temuan-list::-webkit-scrollbar {
    width: 6px;
}
.temuan-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}
.temuan-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 3px;
}
.temuan-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.45);
}

.temuan-item {
    background: rgba(239, 68, 68, 0.05);
    border-left: 3px solid var(--status-error);
    padding: 0.4rem 0.6rem;
    border-radius: 0 6px 6px 0;
    color: #fca5a5;
    line-height: 1.3;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
.main-content {
    padding: 2.5rem 3rem;
    overflow-y: auto;
    height: 100vh;
}

.header-section {
    margin-bottom: 2.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.welcome-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 0.35rem;
}

.welcome-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-indigo));
    border: none;
    border-radius: 12px;
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.25);
    transition: var(--transition-smooth);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 210, 255, 0.35);
}

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
    background: var(--bg-glass);
    border: 1px dashed var(--border-glass);
    border-radius: 24px;
    gap: 1.25rem;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    color: var(--text-muted);
}

.empty-state-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* Criteria Section */
.kriteria-group {
    margin-bottom: 3rem;
}

.kriteria-title-card {
    background: linear-gradient(to right, rgba(0, 210, 255, 0.15), transparent);
    border-left: 4px solid var(--accent-blue);
    padding: 0.875rem 1.25rem;
    border-radius: 0 12px 12px 0;
    margin-bottom: 1.25rem;
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.2px;
    color: var(--text-primary);
}

.butir-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

.butir-card {
    background: var(--bg-glass);
    border: 1px solid var(--border-glass);
    border-radius: 16px;
    padding: 1.5rem;
    display: grid;
    grid-template-columns: 1fr 220px;
    gap: 1.5rem;
    transition: var(--transition-smooth);
}

.butir-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(20, 30, 60, 0.55);
}

.butir-card.loading {
    opacity: 0.5;
    pointer-events: none;
}

.butir-info {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.butir-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-kode {
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-blue);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    border: 1px solid rgba(0, 210, 255, 0.15);
}

.tag-bobot {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-secondary);
    font-size: 0.725rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid var(--border-glass);
}

.tag-threshold {
    background: rgba(245, 158, 11, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.butir-nama {
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.butir-control-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    justify-content: center;
}

.score-input-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.input-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.score-value-badge {
    color: var(--accent-blue);
}

.slider-input {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: rgba(255, 255, 255, 0.1);
    outline: none;
    transition: var(--transition-smooth);
}

.slider-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--accent-blue);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 210, 255, 0.5);
    transition: var(--transition-smooth);
}

.slider-input::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.notes-input {
    width: 100%;
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 8px;
    padding: 0.4rem 0.6rem;
    font-family: var(--font-sans);
    font-size: 0.75rem;
    color: var(--text-primary);
    resize: none;
    outline: none;
    transition: var(--transition-smooth);
}

.notes-input:focus {
    border-color: var(--accent-blue);
    background: rgba(10, 15, 30, 0.6);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1000;
}

.toast {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--border-glass);
    border-left: 4px solid var(--accent-blue);
    color: var(--text-primary);
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    font-size: 0.875rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transform: translateX(120%);
    transition: all 0.35s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    border-left-color: var(--status-success);
}

.toast.error {
    border-left-color: var(--status-error);
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.75rem;
}
.tab-pill {
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border-glass);
    color: var(--text-secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}
.tab-pill:hover, .tab-pill.active {
    background: var(--accent-blue);
    color: #000;
    border-color: var(--accent-blue);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.35);
}
.tab-panel {
    display: none;
}
.tab-panel.active {
    display: block;
}

/* Chat & Mock Assessor Components */
.chat-logs {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    height: 350px;
    overflow-y: auto;
    padding: 1rem;
    background: rgba(10, 15, 30, 0.4);
    border: 1px solid var(--border-glass);
    border-radius: 12px;
    margin-bottom: 1rem;
}
.chat-bubble {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.875rem;
    line-height: 1.4;
}
.user-bubble {
    align-self: flex-end;
    background: var(--accent-blue);
    color: #000;
    border-bottom-right-radius: 2px;
}
.model-bubble {
    align-self: flex-start;
    background: var(--bg-secondary);
    border: 1px solid var(--border-glass);
    color: var(--text-primary);
    border-bottom-left-radius: 2px;
}
.system-bubble {
    align-self: center;
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-radius: 8px;
}
.chat-input-container {
    display: flex;
    gap: 0.75rem;
}

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

/* Responsive */
@media (max-width: 1024px) {
    .app-container {
        grid-template-columns: 1fr;
        min-height: 100vh;
    }

    /* Tablet: sidebar menjadi panel scrollable di atas konten utama */
    .sidebar {
        position: relative;
        height: auto;
        max-height: 60vh;        /* Batas tinggi agar bisa scroll */
        overflow-y: auto;        /* Scrollbar muncul jika konten melebihi 60vh */
        border-right: none;
        border-bottom: 1px solid var(--border-glass);
    }

    .main-content {
        height: auto;
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 768px) {
    .sidebar {
        max-height: 55vh;
        padding: 1rem 0.75rem;
    }
    .main-content {
        padding: 1.25rem 1rem;
    }
}

/* Modal Overlay Utility */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(5, 7, 15, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
