:root {
    --primary: #3b82f6;
    --primary-light: #eff6ff;
    --primary-dark: #2563eb;
    --secondary: #64748b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    
    --jalur-domisili: #10b981;
    --jalur-prestasi: #8b5cf6;
    --jalur-mutasi: #f59e0b;
    --jalur-afirmasi: #ef4444;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    padding-bottom: env(safe-area-inset-bottom, 2rem);
}

/* STICKY APP HEADER */
.header {
    background-color: rgba(59, 130, 246, 0.95);
    color: white;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 20px -2px rgba(59, 130, 246, 0.25);
}

.header-content {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-titles h1 {
    font-size: 1.15rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 0.2rem;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.header-titles span {
    font-size: 0.8rem;
    color: #e0e7ff;
    font-weight: 500;
}

.badges {
    display: flex;
    gap: 0.4rem;
    font-size: 0.7rem;
    margin-top: 0.6rem;
    flex-wrap: wrap;
}

.badge {
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.badge.akreditasi {
    background-color: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.badge.npsn {
    background-color: rgba(0, 0, 0, 0.2);
}

/* MAIN CONTAINER */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 1.25rem 1rem 3rem 1rem;
}

.page-title {
    margin-bottom: 1.25rem;
}

.page-title h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.disclaimer {
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

/* HORIZONTAL SCROLL FOR STATS (SUPER MOBILE FRIENDLY) */
/* GRID LAYOUT FOR STATS (COMPACT & NO HORIZONTAL SCROLL) */
.summary-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.summary-card {
    background: var(--card-bg);
    padding: 0.75rem 0.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0,0,0,0.02);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.summary-value {
    display: block;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 0.2rem;
}

.summary-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.summary-card.domisili .summary-value { color: var(--jalur-domisili); }
.summary-card.prestasi .summary-value { color: var(--jalur-prestasi); }
.summary-card.mutasi .summary-value { color: var(--jalur-mutasi); }
.summary-card.afirmasi .summary-value { color: var(--jalur-afirmasi); }

/* FLOATING FILTER SECTION */
.filter-section {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 16px;
    box-shadow: 0 4px 15px -3px rgba(0, 0, 0, 0.05);
    border: 1px solid white;
}

.search-box, .filter-box {
    position: relative;
    width: 100%;
}

.search-box i, .filter-box i {
    position: absolute;
    left: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
}

input, select {
    width: 100%;
    padding: 0.85rem 1.2rem 0.85rem 3rem;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-main);
    background-color: var(--bg-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    appearance: none;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.2rem center;
    background-size: 1.2em;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    background-color: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

/* LIST CARDS - APP LIKE */
.cards-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.student-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 1.25rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    border: none;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: transform 0.15s ease;
    position: relative;
    overflow: hidden;
}

.student-card:active {
    transform: scale(0.97);
    background-color: #fcfcfc;
}

/* Color accents using pseudo elements to save markup */
.student-card::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
    background-color: var(--border-color);
    border-top-left-radius: 16px;
    border-bottom-left-radius: 16px;
}

.student-card[data-jalur="Jalur Domisili"]::after { background-color: var(--jalur-domisili); }
.student-card[data-jalur="Prestasi"]::after { background-color: var(--jalur-prestasi); }
.student-card[data-jalur="Jalur Mutasi"]::after { background-color: var(--jalur-mutasi); }
.student-card[data-jalur="Jalur Afirmasi"]::after { background-color: var(--jalur-afirmasi); }

.rank-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.15rem;
    flex-shrink: 0;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.student-info {
    flex: 1;
    min-width: 0; /* needed for text-overflow to work in flex */
}

.student-name {
    font-weight: 700;
    color: var(--text-main);
    font-size: 1.05rem;
    margin-bottom: 0.45rem;
    word-break: break-word;
    text-transform: capitalize;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.student-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.student-jalur {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--secondary);
    font-weight: 600;
    font-size: 0.8rem;
    background: var(--bg-color);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
}

.student-jalur i {
    font-size: 0.75rem;
}

.student-score {
    font-weight: 800;
    color: var(--text-main);
    font-size: 0.95rem;
}

.no-data {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.no-data i {
    font-size: 3.5rem;
    margin-bottom: 1.25rem;
    color: #cbd5e1;
}

.hidden {
    display: none !important;
}
