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

/* Default Light Mode */
:root {
    --primary: #4f46e5;
    --primary-hover: #4338ca;
    --secondary: #ec4899;
    --bg-color: #f1f5f9;
    --surface: rgba(255, 255, 255, 0.8);
    --surface-border: rgba(0, 0, 0, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --input-bg: rgba(255, 255, 255, 0.9);
    --bg-gradient: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --nav-bg: rgba(255, 255, 255, 0.6);
    --th-bg: rgba(0, 0, 0, 0.05);
    --tr-hover: rgba(0, 0, 0, 0.02);
}

/* Dark Mode Theme */
[data-theme="dark"] {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --surface: rgba(255, 255, 255, 0.05);
    --surface-border: rgba(255, 255, 255, 0.1);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --input-bg: rgba(15, 23, 42, 0.6);
    --bg-gradient: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
    --nav-bg: rgba(15, 23, 42, 0.6);
    --th-bg: rgba(0, 0, 0, 0.2);
    --tr-hover: rgba(255, 255, 255, 0.02);
}

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

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

/* Glassmorphism Classes */
.glass {
    background: var(--surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 1rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

* { transition: background-color 0.3s, border-color 0.3s; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    width: 100%;
}

.auth-container, .form-container {
    max-width: 650px;
    margin: 4rem auto;
    width: 100%;
    padding: 0 1rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    background: var(--input-bg);
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

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

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    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-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--surface-border);
}

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

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

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}
.theme-toggle:hover {
    background: var(--surface-border);
}

/* Badges */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.badge-pending { background: rgba(245, 158, 11, 0.1); color: var(--warning); border: 1px solid var(--warning); }
.badge-approved { background: rgba(16, 185, 129, 0.1); color: var(--success); border: 1px solid var(--success); }
.badge-rejected { background: rgba(239, 68, 68, 0.1); color: var(--danger); border: 1px solid var(--danger); }

/* Tables */
.table-wrapper {
    overflow-x: auto;
    margin-top: 2rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

th, td {
    padding: 1rem;
    border-bottom: 1px solid var(--surface-border);
}

th {
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--th-bg);
}

tbody tr:hover {
    background: var(--tr-hover);
}

/* Nav */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--surface-border);
    backdrop-filter: blur(10px);
    background: var(--nav-bg);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--bg-color);
    padding: 2rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    border: 1px solid var(--surface-border);
    color: var(--text-primary);
}

/* Utilities */
.text-center { text-align: center; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mb-4 { margin-bottom: 1rem; }
.flex { display: flex; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }
.w-full { width: 100%; }

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

/* --- Cap Background Watermark --- */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 60vw;
    height: 60vw;
    max-width: 600px;
    max-height: 600px;
    background-image: url('Cap.png');
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
    z-index: -1;
    opacity: 0.05; /* transparent */
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: slowFloatCap 15s infinite alternate ease-in-out;
}

[data-theme="dark"] body::before {
    opacity: 0.08;
}

@keyframes slowFloatCap {
    0% { transform: translate(-50%, -50%) scale(1) rotate(-2deg); }
    100% { transform: translate(-50%, -50%) scale(1.05) rotate(2deg); }
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    margin-top: auto;
    color: var(--text-secondary);
    font-size: 0.875rem;
    border-top: 1px solid var(--surface-border);
    background: var(--nav-bg);
    backdrop-filter: blur(10px);
    position: sticky;
    bottom: 0;
    z-index: 100;
}

/* Responsive Rules for Mobile */
@media (max-width: 768px) {
    .flex.gap-4 {
        flex-direction: column;
    }
    .flex.gap-4 > .form-group {
        margin-bottom: 1.5rem;
    }
    
    .auth-container, .form-container {
        margin: 2rem auto;
    }

    .glass {
        padding: 1.5rem !important;
    }

    nav {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Cyber Grid Canvas Background */
#cyber-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    pointer-events: none;
}

/* Premium Professional Login Page Design */
.login-card {
    max-width: 440px;
    margin: 6rem auto;
    padding: 2.5rem;
    border-radius: 1.5rem;
    background: rgba(15, 23, 42, 0.45); /* Sleek dark glass */
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.4), 
                0 0 50px -10px rgba(99, 102, 241, 0.1); /* Indigo glow */
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    position: relative;
    overflow: hidden;
    z-index: 10;
}

[data-theme="light"] .login-card {
    background: rgba(255, 255, 255, 0.55); /* Sleek light glass */
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.08), 
                0 0 50px -10px rgba(79, 70, 229, 0.05);
}

.card-glow {
    position: absolute;
    top: -150px;
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(99, 102, 241, 0.15) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 15px rgba(99, 102, 241, 0.2));
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--text-primary) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.25rem;
}

.login-subtitle {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 290px;
    margin: 0 auto 2rem auto;
    line-height: 1.4;
}

.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    padding-left: 2.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--surface-border);
    border-radius: 0.75rem;
    font-size: 0.95rem;
}

[data-theme="dark"] .input-wrapper input {
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.input-wrapper input:focus {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .input-wrapper input:focus {
    background: rgba(15, 23, 42, 0.6);
}

.input-icon {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    transition: color 0.3s ease;
    pointer-events: none;
    font-size: 0.95rem;
}

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

.btn-login {
    background: linear-gradient(135deg, var(--primary) 0%, #8b5cf6 100%);
    color: white;
    padding: 0.85rem 1.5rem;
    border-radius: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-login:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, #7c3aed 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.35);
}

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


