/* Custom CSS untuk Portal Absensi Siswa - Tema Gelap Glassmorphism */

:root {
    --bg-main: #06040b;
    --bg-card: rgba(18, 14, 32, 0.6);
    --border-card: rgba(139, 92, 246, 0.22);
    --text-primary: #f3f1f7;
    --text-secondary: #a49eb5;
    --primary: #8b5cf6;
    --primary-hover: #7c3aed;
    --secondary: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --glass-blur: 20px;
    --shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 20px rgba(139, 92, 246, 0.3);
}

body.light-theme {
    --bg-main: #f3f4f6;
    --bg-card: rgba(255, 255, 255, 0.82);
    --border-card: rgba(138, 92, 246, 0.12);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --primary: #6d28d9;
    --primary-hover: #5b21b6;
    --secondary: #0891b2;
    --success: #059669;
    --warning: #d97706;
    --danger: #dc2626;
    --shadow: 0 8px 32px 0 rgba(138, 92, 246, 0.08);
    --glass-blur: 16px;
    background-image:
        radial-gradient(at 0% 0%, rgba(109, 40, 217, 0.05) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(8, 145, 178, 0.05) 0px, transparent 50%);
}

* {
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    background-image:
        radial-gradient(at 0% 0%, rgba(139, 92, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 0;
}

/* Glassmorphism Card Wrapper */
.glass-card {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: var(--shadow);
    border-radius: 24px;
}

.portal-card {
    width: 100%;
    max-width: 580px;
    margin: 0 auto;
    padding: 40px 30px;
}

/* Header & Jam Digital */
.school-logo {
    width: 75px;
    height: 75px;
    filter: drop-shadow(0 4px 10px rgba(139, 92, 246, 0.3));
    margin-bottom: 10px;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.digital-clock-container {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 10px 16px;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

#live-time {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(139, 92, 246, 0.3);
}

#live-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

/* Inputs & Form Controls */
.form-group label {
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--text-primary);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.field-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.portal-input {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 10px;
    color: var(--text-primary) !important;
    padding: 12px 16px;
    outline: none;
    font-size: 0.95rem;
    height: auto !important;
}

.portal-input:focus {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.25);
}

select.portal-input option {
    background-color: #120e20;
    color: #f3f1f7;
}

body.light-theme select.portal-input option {
    background-color: #ffffff;
    color: #1f2937;
}

/* Uploader Custom untuk Sakit/Izin */
.custom-file-upload {
    position: relative;
    width: 100%;
    height: 110px;
    background: rgba(139, 92, 246, 0.05);
    border: 2px dashed var(--border-card);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
    transition: all 0.25s ease;
}

.custom-file-upload:hover {
    background: rgba(139, 92, 246, 0.08);
    border-color: var(--primary);
}

.custom-file-upload input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    pointer-events: none;
}

.upload-icon {
    width: 32px;
    height: 32px;
    color: var(--primary);
}

#file-chosen-text {
    font-size: 0.88rem;
    font-weight: 500;
}

/* Panel GPS & Leaflet Map */
.gps-status-panel {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-card);
    border-radius: 12px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gps-details {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
}

.gps-indicator-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--warning);
    box-shadow: 0 0 8px var(--warning);
}

.gps-indicator-dot.online {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.gps-indicator-dot.error {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
}

.gps-coords {
    font-family: monospace;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

#student-map {
    height: 240px;
    border-radius: 14px;
    border: 1px solid var(--border-card);
    margin-bottom: 24px;
    z-index: 1;
}

/* Kamera & Preview */
.camera-wrapper {
    width: 220px;
    height: 290px;
    border-radius: 16px;
    border: 2px solid var(--border-card);
    overflow: hidden;
    position: relative;
    background: #000;
    box-shadow: var(--shadow);
}

#video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#photo-preview-container {
    width: 100%;
    height: 100%;
}

#photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-shoot-action,
.btn-retake-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.btn-shoot-action {
    background: var(--success);
    color: #fff;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.3);
}

.btn-shoot-action:hover {
    transform: scale(1.03);
}

.btn-retake-action {
    background: var(--warning);
    color: #fff;
    box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
}

.btn-retake-action:hover {
    transform: scale(1.03);
}

/* Premium Buttons */
.btn-premium {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1rem;
    text-decoration: none;
    box-shadow: var(--shadow-glow);
    transition: all 0.2s ease-in-out;
}

.btn-premium:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-premium svg {
    width: 18px;
    height: 18px;
}

/* Floating Action Button (FAB) */
.fab-container {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

.fab-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.fab-btn:hover {
    transform: scale(1.08) rotate(45deg);
    background: var(--primary-hover);
    color: #fff;
}

.fab-btn svg {
    width: 24px;
    height: 24px;
}

.fab-menu {
    display: none;
    flex-direction: column;
    gap: 10px;
    align-items: flex-end;
    animation: slideUp 0.3s ease;
}

.fab-menu.show {
    display: flex;
}

.fab-item {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    backdrop-filter: blur(10px);
    width: auto;
    height: 44px;
    padding: 0 16px;
    border-radius: 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none !important;
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}

.fab-item:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
    transform: translateX(-5px);
}

.fab-item svg {
    width: 18px;
    height: 18px;
}

.fab-label {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

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

/* Modal Second */
.modal-second {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.65);
    z-index: 1001;
    align-items: center;
    justify-content: center;
}

.modal-second.show-flex {
    display: flex;
}

.modal-content {
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 420px;
    text-align: center;
    position: relative;
    animation: fadeIn 0.4s ease;
}

.modal-icon-warning {
    font-size: 3rem;
}

.btn-modal-close {
    width: 100%;
    justify-content: center;
    padding: 10px;
}

.close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: var(--text-secondary);
    cursor: pointer;
}

.close:hover {
    color: var(--text-primary);
}

.nis-feedback {
    font-size: 0.82rem;
    margin-top: 4px;
    font-weight: 500;
}

.nis-feedback.success {
    color: var(--success);
}

.nis-feedback.error {
    color: var(--danger);
}

/* Responsive */
@media (max-width: 576px) {
    .portal-card {
        padding: 24px 20px;
        border-radius: 18px;
    }

    .container {
        padding: 10px;
    }
}

/* Animations */
#modal-result-icon {
    animation: scaleUp 0.45s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes scaleUp {
    from {
        transform: scale(0);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.theme-toggle-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform 0.2s ease, background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

.theme-toggle-btn:hover {
    transform: scale(1.05);
}