/* ==========================================================================
   NIU Campus Maintenance - Global Styles & Glassmorphism Design System
   ========================================================================== */

   :root {
    /* Color Palette - Cyber & Neon Theme */
    --primary-color: #4F46E5; /* Indigo */
    --primary-hover: #4338CA;
    --secondary-color: #06B6D4; /* Cyan */
    --accent-color: #E11D48; /* Rose */
    --bg-dark: #0F172A;
    
    /* Text Colors */
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --text-muted: #64748B;
    
    /* Glassmorphism Tokens */
    --glass-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --glass-blur: blur(16px);
    
    /* UI Metrics */
    --border-radius: 16px;
    --transition-speed: 0.3s;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Background Overlay */
.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('/assets/niu_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: -2;
}

.bg-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Dark gradient overlay to ensure text readability */
    background: linear-gradient(135deg, rgba(15,23,42,0.8) 0%, rgba(15,23,42,0.4) 100%);
    z-index: -1;
}

/* Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header */
.glass-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    margin-bottom: 2rem;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-logo {
    height: 40px;
    width: auto;
    filter: drop-shadow(0 0 8px rgba(255,255,255,0.2));
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94A3B8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 0.75rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-text-fill-color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    vertical-align: super;
    margin-left: 0.5rem;
}

.user-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.welcome-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Base Glass Panel/Card */
.glass-panel, .glass-card {
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--glass-shadow);
    padding: 2rem;
}

/* Auth Section */
.auth-panel {
    max-width: 450px;
    margin: 4rem auto;
    position: relative;
    overflow: hidden;
}

/* Subtle glow behind auth panel */
.auth-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(79,70,229,0.15) 0%, transparent 50%);
    z-index: -1;
    animation: rotate 20s linear infinite;
}

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

.tab-controls {
    display: flex;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--glass-border);
}

.tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-speed);
    position: relative;
}

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

.tab-btn.active {
    color: var(--primary-color);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
    box-shadow: 0 0 10px var(--primary-color);
}

.auth-form h2 {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

/* Form Inputs */
.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    transition: var(--transition-speed);
}

input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    padding: 1rem 1rem 1rem 3rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition-speed);
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

input:focus + .input-icon, textarea:focus + .input-icon {
    color: var(--primary-color);
}

/* Buttons */
.btn {
    display: inline-block;
    font-family: inherit;
    font-weight: 600;
    font-size: 1rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-speed);
    text-align: center;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.6);
}

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

.btn-outline {
    background: transparent;
    border: 1px solid var(--glass-border);
    color: var(--text-secondary);
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
    display: block;
}

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.submit-card h2, .reports-card h2 {
    font-size: 1.25rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    color: white;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    transform: translateX(120%);
}

.toast.show {
    transform: translateX(0);
}

.toast.success { border-left: 4px solid #10B981; }
.toast.error { border-left: 4px solid var(--accent-color); }

/* Utilities */
.hidden { display: none !important; }
.error-text {
    color: var(--accent-color);
    font-size: 0.85rem;
    margin-top: 1rem;
    text-align: center;
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-out forwards;
}

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

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}
::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 4px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}
.modal-content {
    max-width: 450px;
    width: 90%;
    text-align: center;
    animation: fadeIn 0.3s ease-out forwards;
}
.qr-container {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: inline-block;
    margin: 1rem 0;
}
.qr-container img {
    width: 200px;
    height: 200px;
}
.backup-codes-box {
    background: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 8px;
    font-family: monospace;
    text-align: left;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    line-height: 1.8;
}
.mt-4 { margin-top: 1rem; }

/* Admin UI Styles */
.full-width {
    width: 100%;
}
.table-responsive {
    width: 100%;
    overflow-x: auto;
    margin-top: 1rem;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
    color: var(--text-color);
}
.admin-table th, .admin-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.admin-table th {
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 1px;
}
.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}
.text-center {
    text-align: center;
}
.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
    margin-right: 5px;
}
.btn-success {
    background: rgba(46, 213, 115, 0.2);
    border: 1px solid rgba(46, 213, 115, 0.5);
    color: #2ed573;
}
.btn-success:hover {
    background: rgba(46, 213, 115, 0.4);
}
.btn-warning {
    background: rgba(255, 165, 2, 0.2);
    border: 1px solid rgba(255, 165, 2, 0.5);
    color: #ffa502;
}
.btn-warning:hover {
    background: rgba(255, 165, 2, 0.4);
}
select.glass-select {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    outline: none;
}
select.glass-select option {
    background: #1e272e;
}
