@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Press+Start+2P&display=swap');

:root {
    /* --accent-color is dynamically injected via PHP in the header */
    --accent-glow: color-mix(in srgb, var(--accent-color) 40%, transparent);
    --bg-dark: #0f1016;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #9ca3af;
}

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

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
}

/* Cyber Grid Animation */
body.bg-cyber_grid {
    background-image: 
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 40px 40px;
    background-position: center center;
    animation: moveGrid 15s linear infinite;
}
body.bg-cyber_grid::before {
    content: '';
    position: fixed;
    top: 0; left: 50%; transform: translateX(-50%);
    width: 100vw; height: 100vh;
    background: radial-gradient(circle at 50% 0%, var(--accent-glow), transparent 70%);
    z-index: -1;
    opacity: 0.5;
    animation: pulseGlow 6s infinite alternate ease-in-out;
    pointer-events: none;
}
body.bg-cyber_grid::after {
    content: '';
    position: fixed;
    top: 50%; left: 50%; 
    width: 200vw; height: 200vh;
    background: conic-gradient(from 0deg at 50% 50%, transparent 0deg, var(--accent-glow) 90deg, transparent 180deg, var(--accent-glow) 270deg, transparent 360deg);
    z-index: -2;
    opacity: 0.07;
    animation: rotateConic 30s linear infinite;
    pointer-events: none;
    transform-origin: center center;
    margin-left: -100vw;
    margin-top: -100vh;
}

/* Casual Blobs Animation */
body.bg-casual_blobs::before, body.bg-casual_blobs::after {
    content: '';
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    z-index: -1;
    animation: float 10s infinite ease-in-out alternate;
    pointer-events: none;
}
body.bg-casual_blobs::before {
    width: 400px; height: 400px; background: var(--accent-glow); top: -100px; left: -100px;
}
body.bg-casual_blobs::after {
    width: 300px; height: 300px; background: var(--accent-glow); bottom: -100px; right: -100px; animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0); }
    100% { transform: translate(50px, 50px); }
}

/* Digital Matrix (Hacker) */
body.bg-matrix_rain {
    background-image: 
        linear-gradient(180deg, rgba(0, 0, 0, 0) 50%, rgba(255, 255, 255, 0.05) 50%),
        linear-gradient(rgba(255, 255, 255, 0.02) 2px, transparent 2px);
    background-size: 100% 4px, 40px 100%;
    animation: matrixScroll 20s linear infinite;
}
body.bg-matrix_rain::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: radial-gradient(circle at 50% 100%, var(--accent-glow), transparent 60%);
    z-index: -1;
    opacity: 0.6;
}

/* Sonar Pulse (Radar) */
body.bg-pulse_wave {
    background: radial-gradient(circle at 50% 50%, rgba(0,0,0,0) 0%, var(--bg-dark) 100%);
}
body.bg-pulse_wave::before, body.bg-pulse_wave::after {
    content: '';
    position: fixed;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 200px; height: 200px;
    border-radius: 50%;
    border: 2px solid var(--accent-color);
    z-index: -1;
    opacity: 0;
    animation: sonarPulse 4s infinite cubic-bezier(0.215, 0.61, 0.355, 1);
}
body.bg-pulse_wave::after {
    animation-delay: 2s;
}

/* Cosmic Starfield (Space) */
body.bg-starfield {
    background-image: 
        radial-gradient(1px 1px at 20px 30px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 40px 70px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1px 1px at 50px 160px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 90px 40px, #ffffff, rgba(0,0,0,0)),
        radial-gradient(1.5px 1.5px at 130px 80px, rgba(255,255,255,0.7), rgba(0,0,0,0)),
        radial-gradient(2px 2px at 160px 120px, var(--accent-color), rgba(0,0,0,0));
    background-repeat: repeat;
    background-size: 200px 200px;
    animation: spaceDrift 60s linear infinite;
}
body.bg-starfield::before {
    content: '';
    position: fixed;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle at 50% 50%, var(--accent-glow), transparent 70%);
    z-index: -1;
    opacity: 0.2;
    animation: pulseGlow 10s infinite alternate;
}

/* Realistic Falling Leaves */
body.bg-falling_leaves {
    background-color: var(--bg-dark);
    background-image: 
        url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='rgba(255,255,255,0.1)'%3e%3cpath d='M30 50c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(45 30 50)'/%3e%3cpath d='M150 120c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(-20 150 120)'/%3e%3cpath d='M300 80c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(110 300 80)'/%3e%3cpath d='M80 300c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(15 80 300)'/%3e%3cpath d='M250 280c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(-60 250 280)'/%3e%3c/svg%3e"),
        url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='rgba(255,255,255,0.05)'%3e%3cpath d='M30 50c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(45 30 50)'/%3e%3cpath d='M150 120c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(-20 150 120)'/%3e%3cpath d='M300 80c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(110 300 80)'/%3e%3cpath d='M80 300c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(15 80 300)'/%3e%3cpath d='M250 280c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(-60 250 280)'/%3e%3c/svg%3e"),
        url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400' fill='rgba(255,255,255,0.02)'%3e%3cpath d='M30 50c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(45 30 50)'/%3e%3cpath d='M150 120c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(-20 150 120)'/%3e%3cpath d='M300 80c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(110 300 80)'/%3e%3cpath d='M80 300c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(15 80 300)'/%3e%3cpath d='M250 280c-5-5-8-9-8-13s3-7 8-7 8 3 8 7-3 8-8 13z' transform='rotate(-60 250 280)'/%3e%3c/svg%3e");
    background-size: 500px 500px, 300px 300px, 150px 150px;
    background-repeat: repeat, repeat, repeat;
    animation: leafParallax 20s linear infinite;
}

body.bg-falling_leaves::before {
    content: '';
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: radial-gradient(ellipse at 50% 0%, var(--accent-glow), transparent 70%);
    z-index: -1;
    opacity: 0.3;
}

@keyframes leafParallax {
    0% { background-position: 0px 0px, 0px 0px, 0px 0px; }
    100% { background-position: 100px 500px, -50px 300px, 30px 150px; }
}

@keyframes matrixScroll {
    0% { background-position: 0 0, 0 0; }
    100% { background-position: 0 100vh, 0 0; }
}
@keyframes sonarPulse {
    0% { width: 0; height: 0; opacity: 1; border-width: 4px; }
    100% { width: 150vw; height: 150vw; opacity: 0; border-width: 1px; }
}
@keyframes spaceDrift {
    0% { background-position: 0 0; }
    100% { background-position: -400px 400px; }
}
@keyframes moveGrid {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}
@keyframes pulseGlow {
    0% { opacity: 0.3; transform: translateX(-50%) scale(1); }
    100% { opacity: 0.7; transform: translateX(-50%) scale(1.05); }
}
@keyframes rotateConic {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 8px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    padding: 2rem;
}

/* Navbar */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1.5rem;
    background: rgba(15, 16, 22, 0.8);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    position: sticky;
    top: 1rem;
    margin: 1rem auto;
    max-width: 1200px;
    width: calc(100% - 2rem);
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.2);
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-brand span {
    color: var(--accent-color);
}

.nav-links {
    display: flex;
    gap: 1.5rem;
}

.nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-links a:hover {
    color: var(--text-main);
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: var(--accent-color);
    color: #fff;
    box-shadow: 0 0 20px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--accent-glow);
    filter: brightness(1.1);
}

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

.btn-outline:hover {
    background: var(--glass-bg);
    border-color: var(--accent-color);
}

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

.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: calc(100vh - 100px);
    gap: 1.5rem;
    position: relative;
    padding-bottom: 5rem;
}

@keyframes floatDown {
    0% { transform: translateY(0); }
    50% { transform: translateY(10px); }
    100% { transform: translateY(0); }
}

.scroll-indicator {
    position: absolute;
    bottom: 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    animation: floatDown 2s infinite ease-in-out;
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s;
}

.scroll-indicator:hover {
    color: var(--accent-color);
}

.hero h1 {
    font-size: 4rem;
    line-height: 1.2;
    background: linear-gradient(to right, #fff, var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 600px;
}

/* Forms */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.auth-form {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-form h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

@media (max-width: 850px) {
    .split-auth {
        flex-direction: column !important;
        max-width: 450px !important;
    }
    .auth-sidebar {
        display: none !important;
    }
    .split-auth-left {
        border-right: none !important;
        border-bottom: 1px solid var(--glass-border);
    }
}

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

.form-group label {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 1rem;
    border-radius: 6px;
    background: rgba(0,0,0,0.2);
    border: 1px solid var(--glass-border);
    color: #fff;
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--accent-color);
    box-shadow: 0 0 10px var(--accent-glow);
}

/* Custom Select Dropdown Styling */
select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
    padding-right: 2.5rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

select.form-control:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border-color: rgba(255, 255, 255, 0.2);
}

select.form-control option {
    background-color: #1a1a24;
    color: #ffffff;
    padding: 12px;
    font-size: 1rem;
    border: none;
}

select.form-control option:hover {
    background-color: var(--accent-color);
}

.error-msg, .success-msg {
    padding: 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    text-align: center;
}

.error-msg {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-msg {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

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

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--glass-border);
}

/* Footer */
.footer {
    margin-top: auto;
    padding: 1.5rem 2rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    background: rgba(15, 16, 22, 0.5);
    backdrop-filter: blur(10px);
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer span {
    color: var(--accent-color);
}

.minecraft-font {
    font-family: 'Press Start 2P', cursive;
    text-transform: none !important;
}

.shine-text {
    background: linear-gradient(110deg, var(--accent-color) 40%, #ffffff 50%, var(--accent-color) 60%);
    background-size: 200% auto;
    color: var(--accent-color);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shine 3s linear infinite;
    display: inline-block;
}

@keyframes shine {
    0% {
        background-position: 200% center;
    }
    100% {
        background-position: -200% center;
    }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Utility to completely hide scrollbar but allow scrolling */
.no-scrollbar {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}
.no-scrollbar::-webkit-scrollbar {
    display: none;
}

/* ========================================= */
/* RESPONSIVE DESIGN                         */
/* ========================================= */

@media (max-width: 900px) {
    .container {
        padding: 1rem;
    }
    
    .navbar {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }

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

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1rem;
        padding: 0 1rem;
    }

    .dashboard-header {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
        text-align: center;
        width: 100%;
    }

    /* Scroll Indicator Mobile Fix */
    .scroll-indicator {
        position: relative !important;
        bottom: auto !important;
        margin-top: 2rem;
    }

    /* Floating Sidebars Mobile Fix - Hide completely on phone as requested */
    #user-sidebar, #admin-sidebar, #user-sidebar-right, #admin-sidebar-right {
        display: none !important;
    }

    /* Table Responsiveness */
    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    /* Cards Grid Mobile */
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 450px) {
    .hero h1 {
        font-size: 2rem;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
    
    .nav-links .btn {
        width: auto;
    }
}
