/* Global Styles & Variables */
:root {
    --bg-gradient: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    --card-bg: #ffffff;
    --card-border: #e2e8f0;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --primary-color: #1d4ed8; /* Biru OSIS SMP */
    --primary-hover: #1e40af;
    --accent-color: #0ea5e9;
    --success-color: #059669;
    --warning-color: #d97706;
    --danger-color: #dc2626;
    --font-family: 'Plus Jakarta Sans', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-gradient);
    font-family: var(--font-family);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
}

/* Background Decorative Elements */
.glass-bg-decor {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    opacity: 0.20;
}

.decor-1 {
    width: 350px;
    height: 350px;
    background: var(--primary-color);
    top: 10%;
    left: 15%;
}

.decor-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-color);
    bottom: 15%;
    right: 15%;
}

/* Layout Container */
.app-container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    z-index: 10;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 2.5rem;
    animation: fadeInDown 0.8s ease-out;
}

.logo-wrapper {
    margin-bottom: 1rem;
}

.school-logo {
    width: 90px;
    height: 90px;
    object-fit: contain;
    border-radius: 16px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 12px 0 rgba(30, 41, 59, 0.08);
}

.header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(to right, #1e3a8a, #2563eb, #0284c7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    font-weight: 500;
}

/* Main Grid Layout */
.main-content {
    margin-bottom: 3rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    body {
        padding: 1rem 0.5rem;
    }
}

/* Section Cards (Glassmorphism) */
.section-card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--card-border);
    border-radius: 24px;
    padding: 2.25rem;
    box-shadow: 0 10px 30px 0 rgba(30, 41, 59, 0.05);
    transition: var(--transition);
    animation: fadeInUp 0.8s ease-out;
}

.section-card:hover {
    border-color: #cbd5e1;
    box-shadow: 0 16px 40px 0 rgba(29, 78, 216, 0.08);
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.card-title i {
    color: var(--primary-color);
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
}

/* Search Form */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    padding: 1.1rem 1.25rem 1.1rem 3.25rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 16px;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    outline: none;
    transition: var(--transition);
}

.input-group input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.12);
    background: #ffffff;
}

/* Primary Button with minimum touch target */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 16px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 600;
    padding: 1.1rem;
    min-height: 48px;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: var(--transition);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.hidden {
    display: none !important;
}

/* Alert Boxes */
.alert {
    padding: 1.25rem;
    border-radius: 16px;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-top: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    border: 1px solid transparent;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.alert-warning {
    background: rgba(245, 158, 11, 0.15);
    border-color: rgba(245, 158, 11, 0.25);
    color: #fcd34d;
}

.alert-warning h4 {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

/* Results Section */
.result-container {
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    animation: fadeIn 0.5s ease-out;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.75rem;
}

.student-avatar {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(217, 70, 239, 0.2) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 18px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem;
    color: var(--primary-color);
}

.result-header h3 {
    font-size: 1.35rem;
    font-weight: 700;
}

.nisn-tag {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.15rem;
}

.nisn-tag span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Subject Score Cards */
.scores-table-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

@media (max-width: 576px) {
    .scores-table-container {
        grid-template-columns: 1fr;
    }
}

.subject-score-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    transition: var(--transition);
}

.subject-score-card:hover {
    border-color: #cbd5e1;
    background: #f1f5f9;
}

.subject-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 1.25rem;
}

.subject-score-card.bahasa .subject-title i {
    color: #0284c7;
}

.subject-score-card.matematika .subject-title i {
    color: #e11d48;
}

.score-details {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.score-num {
    font-size: 2.75rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    color: var(--text-primary);
}

.score-predicate {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #f1f5f9;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.score-predicate strong {
    font-size: 1rem;
    color: var(--accent-color);
}

/* Statistics Side Section */
.stats-period {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.stats-group h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.stats-group h3 i {
    font-size: 0.9rem;
}

.stats-group:first-of-type h3 i { color: #0284c7; }
.stats-group.mt-6 h3 i { color: #e11d48; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.stat-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 1rem 0.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.stat-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.stat-card.highest .stat-value { color: var(--success-color); }
.stat-card.lowest .stat-value { color: var(--danger-color); }
.stat-card.average .stat-value { color: var(--warning-color); }

.stats-no-data {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.stats-no-data i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mt-6 {
    margin-top: 2rem;
}

/* Footer Section */
.footer {
    text-align: center;
    margin-top: 2.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer p {
    margin-bottom: 0.5rem;
}

.admin-link-wrapper {
    margin-top: 0.75rem;
}

.admin-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 44px;
    transition: var(--transition);
}

.admin-link:hover {
    color: var(--primary-color);
    background: #f1f5f9;
    border-color: #94a3b8;
}

/* Keyframe Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Search Progress Bar */
.progress-container {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.3s ease-in-out;
}

.progress-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-weight: 600;
}

.progress-bar-outer {
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 999px;
    overflow: hidden;
    position: relative;
}

.progress-bar-inner {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    border-radius: 999px;
    transition: width 3s linear;
}
