/* Font loaded via <link> in HTML for non-blocking render */

:root {
    --bg-dark: #0f172a;
    --bg-card: #1e293b;
    --bg-card-hover: #263347;
    --primary: #0f766e;
    --primary-light: #14b8a6;
    --primary-glow: rgba(20, 184, 166, 0.2);
    --accent: #f59e0b;
    --accent-light: #fbbf24;
    --accent-glow: rgba(245, 158, 11, 0.2);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-light: rgba(255, 255, 255, 0.08);
    --border-glow: rgba(20, 184, 166, 0.4);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #eab308;
    --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(at 0% 0%, rgba(15, 118, 110, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(245, 158, 11, 0.08) 0px, transparent 50%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* Card Container */
.glass-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: 16px;
    box-shadow: 0 4px 16px 0 rgba(0, 0, 0, 0.25);
}

/* Header & Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.2rem 2rem;
    border-bottom: 1px solid var(--border-light);
    background: #0c1322;
    z-index: 100;
    position: sticky;
    top: 0;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: var(--text-main);
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.brand-badge {
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.navbar-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.nav-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.nav-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.nav-btn-danger {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

.nav-btn-danger:hover {
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

/* Layout Wrapper */
.main-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 2rem;
    max-width: 1400px;
    width: 100%;
    margin: 0 auto;
}

/* Main Dashboard Cards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.portal-card {
    position: relative;
    padding: 2.5rem 2rem;
    overflow: hidden;
    cursor: pointer;
    text-decoration: none;
    color: var(--text-main);
    display: flex;
    flex-direction: column;
    height: 380px;
    justify-content: space-between;
}

.portal-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 100% 0%, var(--primary-glow) 0%, transparent 60%);
    opacity: 0;
    transition: var(--transition-smooth);
}

.portal-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-glow);
    box-shadow: 0 12px 40px rgba(20, 184, 166, 0.15);
}

.portal-card:hover::before {
    opacity: 1;
}

.portal-card.absensi-card::before {
    background: radial-gradient(circle at 100% 0%, var(--accent-glow) 0%, transparent 60%);
}

.portal-card.absensi-card:hover {
    border-color: rgba(245, 158, 11, 0.4);
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.1);
}

.card-icon {
    width: 65px;
    height: 65px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-light);
    border: 1px solid var(--border-light);
    margin-bottom: 1.5rem;
    transition: var(--transition-smooth);
}

.portal-card:hover .card-icon {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

.absensi-card .card-icon {
    color: var(--accent);
}

.portal-card.absensi-card:hover .card-icon {
    background: var(--accent);
    color: white;
}

.card-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.card-desc {
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.card-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--primary-light);
    transition: var(--transition-smooth);
}

.absensi-card .card-action {
    color: var(--accent);
}

.portal-card:hover .card-action {
    gap: 0.8rem;
}

/* Quick Stats Bar */
.stats-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.2rem;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--primary-light);
    border: 1px solid var(--border-light);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
}

/* Page Layout with Sidebar */
.layout-with-sidebar {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 2rem;
    margin-top: 1rem;
    flex: 1;
}

.sidebar {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    height: fit-content;
}

.sidebar-menu-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: 1px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 12px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.2s ease, background-color 0.2s ease;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.sidebar-link.active {
    background: rgba(15, 118, 110, 0.15);
    color: var(--primary-light);
    border-left: 3px solid var(--primary-light);
    border-radius: 0 12px 12px 0;
}

.sidebar-link.absensi-active.active {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent);
    border-left-color: var(--accent);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    min-width: 0;
    /* Prevents flex items from overflowing */
}

/* Beautiful Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-control {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid var(--border-light);
    color: var(--text-main);
    padding: 0.8rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    outline: none;
}

.form-control:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 10px var(--primary-glow);
    background: rgba(15, 23, 42, 0.6);
}

select.form-control option {
    background: var(--bg-dark);
    color: var(--text-main);
}

/* Table Design */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid var(--border-light);
}

.custom-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.custom-table th {
    background: rgba(15, 23, 42, 0.6);
    padding: 1rem 1.2rem;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-light);
}

.custom-table td {
    padding: 1rem 1.2rem;
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

.custom-table tbody tr {
    transition: background-color 0.2s ease;
}

.custom-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.02);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.badge-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.badge-warning {
    background: rgba(234, 179, 8, 0.15);
    color: var(--warning);
}

.badge-primary {
    background: rgba(20, 184, 166, 0.15);
    color: var(--primary-light);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 184, 166, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-danger {
    background: linear-gradient(135deg, #b91c1c, #ef4444);
    color: white;
    box-shadow: 0 4px 14px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
    border-radius: 6px;
}

/* Avatars & Photos */
.avatar-img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid var(--border-light);
}

.avatar-container {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

/* Real-Time Live Monitor Layout */
.live-monitor-container {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 2rem;
}

.monitor-card {
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    position: relative;
    overflow: hidden;
}

.scan-pulse-effect {
    position: absolute;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: pulse 2.5s infinite;
}

.scan-icon-large {
    font-size: 5rem;
    color: var(--accent);
    z-index: 10;
    margin-bottom: 1.5rem;
    animation: float 3s ease-in-out infinite;
}

.monitor-student-details {
    display: none;
    text-align: center;
    z-index: 10;
    animation: fadeInUp 0.5s ease;
}

.monitor-student-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--accent);
    box-shadow: 0 0 25px rgba(245, 158, 11, 0.4);
    margin: 0 auto 1.5rem;
}

.monitor-student-name {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #fff, var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.monitor-student-class {
    font-size: 1.2rem;
    color: var(--accent-light);
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.monitor-time-badge {
    background: rgba(245, 158, 11, 0.12);
    color: var(--accent-light);
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.5rem 1.5rem;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Virtual RFID Simulator Hardware Look */
.simulator-box {
    background: linear-gradient(135deg, #1e293b, #0f172a);
    border: 3px solid #334155;
    border-radius: 20px;
    padding: 2rem;
    width: 320px;
    margin: 0 auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
    position: relative;
}

.simulator-lcd {
    background: #022c22;
    border: 3px solid #475569;
    border-radius: 8px;
    padding: 0.8rem;
    height: 90px;
    font-family: 'Courier New', monospace;
    color: #4ade80;
    text-shadow: 0 0 5px rgba(74, 222, 128, 0.7);
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    font-size: 0.85rem;
    line-height: 1.3;
    overflow: hidden;
}

.simulator-lcd-row {
    white-space: nowrap;
    overflow: hidden;
}

.simulator-rfid-zone {
    width: 140px;
    height: 140px;
    border: 4px dashed #64748b;
    border-radius: 50%;
    margin: 0 auto 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    background: rgba(255, 255, 255, 0.02);
}

.simulator-rfid-zone:hover {
    border-color: var(--accent);
    background: rgba(245, 158, 11, 0.05);
    color: var(--accent-light);
}

.simulator-rfid-zone.scanning {
    border-color: var(--success);
    background: rgba(34, 197, 94, 0.1);
    animation: borderBlink 0.5s infinite;
}

.simulator-rfid-zone i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: #64748b;
    transition: var(--transition-smooth);
}

.simulator-rfid-zone:hover i {
    color: var(--accent);
}

.simulator-rfid-zone.scanning i {
    color: var(--success);
}

.simulator-leds {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.led {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #334155;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
    transition: var(--transition-smooth);
}

.led-red.active {
    background: #ef4444;
    box-shadow: 0 0 10px #ef4444, inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

.led-green.active {
    background: #22c55e;
    box-shadow: 0 0 10px #22c55e, inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

.led-blue.active {
    background: #3b82f6;
    box-shadow: 0 0 10px #3b82f6, inset 0 2px 2px rgba(255, 255, 255, 0.5);
}

/* Login Page Design */
.login-container {
    max-width: 450px;
    width: 100%;
    margin: auto;
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-header {
    text-align: center;
}

.login-logo {
    font-size: 3rem;
    color: var(--primary-light);
    margin-bottom: 0.5rem;
    text-shadow: 0 0 15px var(--primary-glow);
}

/* Animations */
@keyframes pulse {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    50% {
        opacity: 0.4;
    }

    100% {
        transform: scale(1.2);
        opacity: 0;
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes borderBlink {

    0%,
    100% {
        border-color: var(--success);
    }

    50% {
        border-color: transparent;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Rules */
@media (max-width: 768px) {
    .layout-with-sidebar {
        grid-template-columns: 1fr;
    }

    .live-monitor-container {
        grid-template-columns: 1fr;
    }

    .navbar {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
}