/* --- 1. CORE SYSTEM: QUANTUM DARK MODE --- */
:root {
    --primary: #3b82f6;
    --accent: #6366f1; /* Indigo */
    --bg-deep: #000000;
    --bg-body: #0f172a;
    
    /* Glass System */
    --glass-nav: rgba(15, 23, 42, 0.85);
    --glass-card: rgba(30, 41, 59, 0.4);
    --glass-border: rgba(255, 255, 255, 0.08);
    
    --text-main: #f1f5f9;
    --text-sub: #94a3b8;
    
    --nav-height: 80px;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; outline: none; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background-color: var(--bg-deep);
    color: var(--text-main);
    min-height: 100vh;
    padding-top: var(--nav-height); 
    
    /* Mesh Gradient Background */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(59, 130, 246, 0.15), transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(99, 102, 241, 0.15), transparent 25%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Custom Scrollbar */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: #334155; border-radius: 10px; }

/* --- 2. FIXED NAVBAR (Top Sidebar Style) --- */
.navbar-fixed {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--nav-height);
    background: var(--glass-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    box-shadow: 0 4px 30px rgba(0,0,0,0.1);
}

.nav-content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

.brand-logo {
    width: 42px; height: 42px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

.brand-text h1 {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    background: linear-gradient(to right, #fff, #cbd5e1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-text span {
    font-size: 0.7rem;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    display: block;
}

.nav-status {
    font-size: 0.75rem;
    color: var(--text-sub);
    display: flex;
    align-items: center;
    gap: 6px;
}
.status-dot { width: 6px; height: 6px; background: #10b981; border-radius: 50%; box-shadow: 0 0 8px #10b981; }

/* --- 3. MAIN LAYOUT --- */
.app-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* --- 4. HERO & SEARCH --- */
.search-section {
    margin-bottom: 2.5rem;
    position: relative;
}

.search-card {
    background: linear-gradient(145deg, rgba(30,41,59,0.7), rgba(15,23,42,0.7));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 8px;
    display: flex;
    gap: 10px;
    box-shadow: 0 20px 40px -10px rgba(0,0,0,0.5);
    transition: all 0.3s ease;
}

.search-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2), 0 20px 40px -10px rgba(0,0,0,0.6);
    transform: translateY(-2px);
}

.search-icon-box {
    width: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-sub);
    font-size: 1.2rem;
}

.search-input {
    flex: 1;
    background: transparent;
    border: none;
    color: white;
    font-size: 1rem;
    font-weight: 500;
    font-family: 'Plus Jakarta Sans', sans-serif;
}
.search-input::placeholder { color: rgba(148, 163, 184, 0.6); }

.btn-search {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 14px;
    padding: 0 24px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
    height: 50px;
}
.btn-search:hover { opacity: 0.9; }

/* --- 5. WIDGETS --- */
.info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.glass-panel {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 16px;
    font-size: 0.8rem;
    line-height: 1.5;
    color: var(--text-sub);
    backdrop-filter: blur(4px);
}

.panel-warning i { color: #ef4444; margin-right: 6px; font-size: 1rem; vertical-align: middle; }
.panel-secure i { color: #10b981; margin-right: 6px; font-size: 1rem; vertical-align: middle; }

/* --- 6. RESULTS (Full Text Visibility Update) --- */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.student-card {
    background: var(--glass-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    /* UPDATE: Menggunakan flex-start agar avatar tetap di atas jika teks panjang */
    align-items: flex-start; 
    gap: 20px;
    position: relative;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    animation: cardEnter 0.4s ease-out forwards;
    opacity: 0;
    height: auto; /* Memastikan tinggi otomatis mengikuti konten */
}

.student-card:hover {
    background: rgba(40, 50, 75, 0.6);
    border-color: rgba(59, 130, 246, 0.4);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Avatar */
.card-avatar {
    width: 56px; height: 56px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(99, 102, 241, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: #60a5fa;
    border: 1px solid rgba(255,255,255,0.05);
    flex-shrink: 0;
    margin-top: 2px; /* Sedikit penyesuaian posisi vertikal */
}

/* Info Section (Flexible Height) */
.card-info {
    flex: 1;
    /* UPDATE: Menghapus min-width:0 yang kadang memicu truncating di flexbox */
    display: flex;
    flex-direction: column;
}

.student-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 6px;
    /* UPDATE: Hapus truncation, izinkan text wrapping */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}

.student-meta {
    display: flex;
    flex-wrap: wrap; /* Izinkan elemen meta turun jika sempit */
    gap: 10px;
    margin-bottom: 10px;
}

.chip {
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(0,0,0,0.3);
    border: 1px solid rgba(255,255,255,0.05);
    color: var(--text-sub);
    font-family: monospace;
    white-space: nowrap; /* NIM tetap satu baris */
}

.uni-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uni-text {
    font-size: 0.9rem;
    color: #cbd5e1;
    /* UPDATE: Hapus truncation, izinkan text wrapping */
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.5;
}

.prodi-text {
    font-size: 0.8rem;
    color: var(--primary);
    font-weight: 500;
    /* UPDATE: Hapus truncation */
    white-space: normal;
    line-height: 1.4;
    margin-top: 2px;
}

/* Arrow Indicator */
.card-action {
    width: 24px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    color: var(--text-sub);
    opacity: 0.5;
    align-self: center; /* Panah tetap di tengah vertikal kartu */
}

/* --- 7. STATES & FOOTER --- */
.status-area {
    text-align: center;
    padding: 4rem 1rem;
    display: none;
}
.loader {
    width: 32px; height: 32px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 15px;
}
.status-text { font-size: 0.9rem; color: var(--text-sub); }

footer {
    text-align: center;
    font-size: 0.75rem;
    color: rgba(148, 163, 184, 0.4);
    margin-top: auto;
    padding-top: 2rem;
}

@keyframes cardEnter { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* Responsive Mobile */
@media (max-width: 600px) {
    .navbar-fixed { padding: 0 1rem; }
    .info-grid { grid-template-columns: 1fr; }
    .student-card { padding: 16px; gap: 14px; }
    .card-avatar { width: 48px; height: 48px; font-size: 1.2rem; }
    .student-name { font-size: 1rem; }
    .brand-text h1 { font-size: 1rem; }
    .card-action { display: none; }
}
