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

:root {
    --e4s-gold: #D4AF37;
    --e4s-gold-glow: rgba(212, 175, 55, 0.6);
    --e4s-bg-dark: #0b0f19;
    --e4s-panel: rgba(16, 22, 36, 0.75);
    --e4s-border: rgba(255, 255, 255, 0.05);
}

/* --- BASE & TYPOGRAPHY --- */
body.dark-mode, .wrapper {
    background-color: var(--e4s-bg-dark) !important;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #e2e8f0;
}

/* --- ANIMATIONS --- */
@keyframes softPulse {
    0% { box-shadow: 0 0 10px var(--e4s-gold-glow); }
    50% { box-shadow: 0 0 25px var(--e4s-gold-glow); }
    100% { box-shadow: 0 0 10px var(--e4s-gold-glow); }
}

@keyframes serverScan {
    0% { background-position: 0% 0%; }
    50% { background-position: 100% 100%; }
    100% { background-position: 0% 0%; }
}

/* --- LOGIN PAGE (Server Room Background + Glass Box) --- */
body.login-page {
    background: linear-gradient(rgba(11, 15, 25, 0.85), rgba(11, 15, 25, 0.9)), 
                url('https://images.unsplash.com/photo-1558494949-ef010cbdcc31?q=80&w=1920&auto=format&fit=crop') no-repeat center center fixed !important;
    background-size: cover !important;
    animation: serverScan 30s ease-in-out infinite alternate;
}

.login-box, .register-box {
    background: rgba(15, 20, 30, 0.65) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.1);
    padding: 20px;
    width: 400px;
    max-width: 90%;
}

.login-card-body, .register-card-body {
    background: transparent !important;
    color: #fff;
}

/* --- PURE CSS LOGO --- */
.e4s-css-logo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 22px;
    font-weight: 700;
    color: #ffffff !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-shadow: 0 0 10px rgba(255,255,255,0.2);
}

.e4s-css-logo::before {
    content: "\f3ed"; /* Shield-alt */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: var(--e4s-gold);
    text-shadow: 0 0 15px var(--e4s-gold);
    font-size: 26px;
}

.e4s-css-logo span {
    color: var(--e4s-gold);
}

/* --- RESTORE & ENHANCE DASHBOARD WIDGETS --- */
.small-box {
    border-radius: 12px;
    border: 1px solid var(--e4s-border);
    box-shadow: 0 8px 20px rgba(0,0,0,0.3) !important;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.small-box:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.5) !important;
}

.small-box.bg-info { background: linear-gradient(135deg, #00c6ff, #0072ff) !important; color: #fff !important; }
.small-box.bg-danger { background: linear-gradient(135deg, #f12711, #f5af19) !important; color: #fff !important; }
.small-box.bg-success { background: linear-gradient(135deg, #11998e, #38ef7d) !important; color: #fff !important; }
.small-box.bg-warning { background: linear-gradient(135deg, #f7971e, #ffd200) !important; color: #111 !important; }

.small-box .icon > i {
    color: rgba(255, 255, 255, 0.25) !important;
}

.small-box:hover .icon > i {
    transform: scale(1.1);
    color: rgba(255, 255, 255, 0.4) !important;
}

/* --- CARDS & GLASSMORPHISM --- */
.card {
    background: var(--e4s-panel) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--e4s-border);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.card-primary.card-outline {
    border-top: 3px solid var(--e4s-gold) !important;
}

.card-header {
    border-bottom: 1px solid var(--e4s-border);
}

/* --- SIDEBAR & NAVBAR --- */
.main-sidebar {
    background: rgba(11, 15, 25, 0.95) !important;
    backdrop-filter: blur(15px);
    border-right: 1px solid var(--e4s-border) !important;
}

.main-header.navbar {
    background: rgba(11, 15, 25, 0.85) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid var(--e4s-border) !important;
}

.brand-link {
    border-bottom: 1px solid var(--e4s-border) !important;
    display: flex !important;
    justify-content: center;
    align-items: center;
    padding: 15px 0 !important;
}

/* Active Nav Links */
.sidebar-dark-primary .nav-sidebar>.nav-item>.nav-link.active {
    background: linear-gradient(90deg, rgba(212,175,55,0.1) 0%, transparent 100%) !important;
    border-left: 3px solid var(--e4s-gold);
    color: var(--e4s-gold) !important;
    border-radius: 0;
}

/* --- BUTTONS --- */
.btn-primary {
    background: linear-gradient(135deg, #D4AF37, #AA7C11) !important;
    border: none !important;
    color: #111 !important;
    font-weight: 700;
    border-radius: 6px;
    transition: all 0.3s;
}

.btn-primary:hover {
    box-shadow: 0 0 15px var(--e4s-gold-glow);
    color: #000 !important;
}

.btn-cyber-support {
    border: 1px solid var(--e4s-gold) !important;
    color: var(--e4s-gold) !important;
    background: transparent;
    border-radius: 6px;
    padding: 6px 16px;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-cyber-support:hover {
    background: var(--e4s-gold) !important;
    color: #111 !important;
    box-shadow: 0 0 15px var(--e4s-gold-glow);
}

/* Badge fix */
.badge-success { background-color: #11998e !important; color: #fff !important; border: none; }
.badge-danger { background-color: #eb3349 !important; color: #fff !important; border: none; }

/* === FIX MODAL OVERLAY & APPLY ROYAL STYLE === */
.modal {
    z-index: 1050 !important;
}
.modal-backdrop {
    z-index: 1040 !important;
    background-color: #050505 !important;
    opacity: 0.8 !important;
}
.modal-dialog {
    z-index: 1060 !important;
}
.modal-content {
    background: rgba(11, 15, 25, 0.95) !important;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.1) !important;
    border-radius: 12px;
}
.modal-header {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important;
}
.modal-footer {
    border-top: 1px solid rgba(212, 175, 55, 0.2) !important;
}
.modal-title {
    color: var(--e4s-gold) !important;
    font-weight: 700;
    letter-spacing: 1px;
}
.modal-header .close {
    color: var(--e4s-gold) !important;
    text-shadow: none;
    opacity: 0.8;
}
.modal-header .close:hover {
    opacity: 1;
}

/* === BULLETPROOF MODAL FIX === */
.modal-backdrop {
    display: none !important;
}
.modal {
    background: rgba(5, 5, 5, 0.85) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    z-index: 99999 !important;
}
.modal-dialog {
    z-index: 100000 !important;
}
.modal-content {
    background: rgba(11, 15, 25, 0.95) !important;
    border: 1px solid rgba(212, 175, 55, 0.4) !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8), 0 0 20px rgba(212, 175, 55, 0.1) !important;
    border-radius: 12px;
}
.modal-header { 
    border-bottom: 1px solid rgba(212, 175, 55, 0.2) !important; 
}
.modal-footer { 
    border-top: 1px solid rgba(212, 175, 55, 0.2) !important; 
}
.modal-title { 
    color: #D4AF37 !important; 
    font-weight: 700; 
}
.close { 
    color: #D4AF37 !important; 
    text-shadow: none; 
    opacity: 0.8; 
}
.close:hover { 
    opacity: 1; 
    color: #FFA500 !important; 
}
