/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --success: #10B981;
    --danger: #EF4444;
    --background: #F3F4F6;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: var(--background);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Background for public page */
body.public-page {
    background: linear-gradient(135deg, #e0eafc 0%, #cfdef3 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glassmorphism Card */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 1.5rem;
    box-shadow: var(--shadow);
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    margin: 1rem;
    text-align: center;
    animation: fadeIn 0.6s ease-out;
}

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

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    background: var(--surface);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.btn {
    display: inline-block;
    width: 100%;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #059669; }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #DC2626; }

/* Status Result */
.result-card {
    margin-top: 2rem;
    padding: 2rem;
    border-radius: 1rem;
    background: var(--surface);
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    display: none; /* Initially hidden */
    animation: scaleIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.result-card.active { display: block; }

.status-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    border-radius: 9999px;
    font-weight: 700;
    font-size: 1.25rem;
    margin: 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.status-lulus {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-gagal {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.student-info {
    margin: 1rem 0;
    text-align: left;
    background: var(--background);
    padding: 1rem;
    border-radius: 0.75rem;
}
.student-info div {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 0.5rem;
}
.student-info div:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}
.student-info span { font-weight: 600; }

/* Admin Dashboard Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    color: var(--primary);
    font-weight: 700;
}

.sidebar-nav {
    padding: 1rem 0;
    flex: 1;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    gap: 0.75rem;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(79, 70, 229, 0.05);
    color: var(--primary);
    border-right: 3px solid var(--primary);
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--background);
}

.topbar {
    background: var(--surface);
    height: 64px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 2rem;
}

.content-wrapper {
    padding: 2rem;
    flex: 1;
    overflow-y: auto;
}

/* Admin Dashboard Components */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--surface);
    padding: 1.5rem;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}
.stat-icon.blue { background: rgba(79,70,229,0.1); color: var(--primary); }
.stat-icon.green { background: rgba(16,185,129,0.1); color: var(--success); }
.stat-icon.red { background: rgba(239,68,68,0.1); color: var(--danger); }

.stat-info h3 { font-size: 0.875rem; color: var(--text-muted); font-weight: 500; }
.stat-info p { font-size: 1.5rem; font-weight: 700; color: var(--text-main); margin: 0; }

.table-card {
    background: var(--surface);
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    border: 1px solid var(--border);
    overflow: hidden;
}

.table-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.table-header h3 { margin: 0; }

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem 1.5rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td { color: var(--text-main); }
tr:last-child td { border-bottom: none; }
tr:hover { background: #F9FAFB; }

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge.lulus { background: rgba(16,185,129,0.1); color: var(--success); }
.badge.gagal { background: rgba(239,68,68,0.1); color: var(--danger); }

/* Buttons Small */
.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 0.5rem;
    width: auto;
}

/* File Manager Grid */
.fm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    padding: 1.5rem;
}

.fm-item {
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1rem;
    text-align: center;
    transition: all 0.2s;
    background: var(--surface);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.fm-item:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.fm-icon {
    font-size: 2.5rem;
    color: var(--primary);
}

.fm-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-main);
    word-break: break-all;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.fm-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    width: 100%;
}
.fm-actions a, .fm-actions button {
    flex: 1;
    padding: 0.25rem;
    font-size: 0.75rem;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1rem;
    font-weight: 500;
}
.alert-error { background: rgba(239,68,68,0.1); color: var(--danger); border: 1px solid rgba(239,68,68,0.2); }
.alert-success { background: rgba(16,185,129,0.1); color: var(--success); border: 1px solid rgba(16,185,129,0.2); }

@media (max-width: 768px) {
    .admin-layout { flex-direction: column; }
    .sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); }
    .sidebar-nav { display: flex; overflow-x: auto; padding: 0.5rem; }
    .sidebar-nav a { padding: 0.5rem 1rem; white-space: nowrap; }
    .content-wrapper { padding: 1rem; }
}
