/* ==========================================================================
   Modern Glassmorphism + Neon Dark Theme for Attendance System
   ========================================================================== */

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

:root {
    --bg-dark: #0d1117;
    --bg-card: rgba(20, 25, 35, 0.65);
    --glass-border: rgba(120, 130, 255, 0.18);
    --glass-glow: 0 8px 32px rgba(31, 38, 135, 0.25);
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --muted: #94a3b8;
    --border: rgba(120, 130, 255, 0.18);
    --accent: #7c3aed;
    --accent-glow: #a78bfa;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
    --border-radius: 16px;
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(124, 58, 237, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    background-attachment: fixed;
}

/* Local icon mapping for legacy Font Awesome markup */
.fas,
.far,
.fab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-style: normal;
    line-height: 1;
    vertical-align: middle;
}

.fas::before,
.far::before,
.fab::before {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 1.1em;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
}

.fa-camera::before { content: 'photo_camera'; }
.fa-calendar-alt::before { content: 'calendar_month'; }
.fa-calendar-day::before { content: 'calendar_today'; }
.fa-calendar-times::before { content: 'event_busy'; }
.fa-chart-line::before { content: 'monitoring'; }
.fa-check::before { content: 'check_circle'; }
.fa-crown::before { content: 'crown'; }
.fa-eye::before { content: 'visibility'; }
.fa-face-smile::before { content: 'sentiment_satisfied'; }
.fa-file-excel::before { content: 'table_view'; }
.fa-fingerprint::before { content: 'fingerprint'; }
.fa-history::before { content: 'history'; }
.fa-info-circle::before { content: 'info'; }
.fa-play::before { content: 'play_arrow'; }
.fa-rocket::before { content: 'rocket_launch'; }
.fa-rotate-right::before { content: 'refresh'; }
.fa-shield-alt::before { content: 'shield'; }
.fa-sign-in-alt::before { content: 'login'; }
.fa-spinner::before { content: 'progress_activity'; }
.fa-times::before { content: 'cancel'; }
.fa-upload::before { content: 'upload'; }
.fa-user::before { content: 'person'; }
.fa-user-circle::before { content: 'account_circle'; }
.fa-user-plus::before { content: 'person_add'; }
.fa-users::before { content: 'groups'; }
.fa-users-cog::before { content: 'manage_accounts'; }
.fa-video::before { content: 'videocam'; }

.fa-spin::before {
    animation: fa-spin 1.2s linear infinite;
}

@keyframes fa-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Responsive Layout for Mobile */
@media (max-width: 600px) {
    .container, .glass, .glass-card {
        padding: 1rem !important;
        margin: 0.5rem !important;
        border-radius: 12px !important;
    }
    h1, h2, h3 {
        font-size: 1.3rem !important;
    }
    .form-group, .form-grid {
        display: block !important;
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    input, select, button, .btn {
        font-size: 1rem !important;
        padding: 0.8rem 1rem !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .modern-table th, .modern-table td {
        padding: 0.7rem 0.5rem !important;
        font-size: 0.9rem !important;
    }
    #faceCamera {
        height: 180px !important;
        min-width: 100% !important;
    }
    .glass {
        margin-bottom: 1rem !important;
    }
}

/* Glass surfaces used across legacy and newer templates */
.glass,
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-glow);
    padding: 1.8rem;
    transition: var(--transition);
}

.glass-card:hover,
.glass:hover {
    transform: translateY(-6px);
    box-shadow: 0 20px 50px rgba(124, 58, 237, 0.25);
}

/* Attendance Record Cards */
.attendance-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.2rem;
    margin-top: 1rem;
}

.attendance-card {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    padding: 1.4rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.06);
}

.card-row-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.card-row-value {
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.card-footer-item {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.card-footer-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.card-footer-value {
    font-size: 0.95rem;
    font-weight: 700;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.9rem 1.8rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border: none;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
}

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

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

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

/* Tables */
.modern-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 0.6rem;
}

.modern-table th,
.modern-table td {
    padding: 1.1rem 1.4rem;
    text-align: left;
    background: rgba(30, 35, 50, 0.6);
}

.modern-table th {
    background: rgba(45, 55, 80, 0.8);
    color: #c7d2fe;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.82rem;
    letter-spacing: 0.5px;
}

.modern-table tr {
    transition: var(--transition);
}

.modern-table tr:hover {
    background: rgba(79, 70, 229, 0.18);
    transform: scale(1.01);
}

/* Status Badges */
.status-badge {
    padding: 0.4rem 1rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
}

.status-present   { background: rgba(16, 185, 129, 0.2); color: #10b981; border: 1px solid #10b98144; }
.status-late      { background: rgba(245, 158, 11, 0.2); color: #f59e0b; border: 1px solid #f59e0b44; }
.status-absent    { background: rgba(239, 68, 68, 0.2); color: #ef4444; border: 1px solid #ef444444; }

/* Responsive */

/* Ensure tables never overflow the viewport */
table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    word-break: break-word;
}

/* Improve touch targets and stack navigation buttons on small screens */
@media (max-width: 900px) {
    body {
        padding: 0.5rem;
    }

    header.glass-card {
        margin: 0.5rem !important;
    }

    header.glass-card > div {
        padding: 1rem !important;
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    header nav {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    header nav a {
        flex: 1 1 100%;
        min-width: 0;
        max-width: 320px;
    }

    main {
        padding: 1rem !important;
    }

    .glass,
    .glass-card {
        padding: 1.2rem !important;
        margin: 0.75rem !important;
    }

    h1 {
        font-size: 2rem !important;
    }

    h2 {
        font-size: 1.5rem !important;
    }

    h3 {
        font-size: 1.25rem !important;
    }

    .btn {
        width: 100% !important;
        justify-content: center;
    }
}

/* Hero background circle (on Home page) */
.hero-bg {
    pointer-events: none;
    opacity: 0.9;
    transition: transform 0.35s ease;
}

@media (max-width: 900px) {
    .hero-bg {
        width: 520px;
        height: 520px;
        top: -40%;
        right: -40%;
    }
}

@media (max-width: 600px) {
    .hero-bg {
        width: 340px;
        height: 340px;
        top: -35%;
        right: -45%;
    }
}

@media (max-width: 768px) {
    .glass-card { padding: 1.4rem; }
    .modern-table { font-size: 0.92rem; }
    .btn { padding: 0.8rem 1.4rem; }
}
