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

:root {
    --bg-color: #090a15;
    --sidebar-bg: #0d0e22;
    --card-bg: #13142d;
    --card-border: #1d203e;
    --text-color: #f1f5f9;
    --text-muted: #707e94;
    --primary: #00d2ff;
    --primary-hover: #00b4ff;
    --primary-glow: rgba(0, 210, 255, 0.15);
    --secondary: #8b5cf6;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --font-sans: 'Outfit', sans-serif;
    --sidebar-width: 280px;
    --glass-bg: rgba(19, 20, 45, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Mobile Header */
.mobile-header {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 64px;
    background-color: var(--sidebar-bg);
    border-bottom: 1px solid var(--card-border);
    z-index: 900;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.25rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.mobile-logo-text {
    font-weight: 700;
    font-size: 1.15rem;
    letter-spacing: -0.3px;
}

.mobile-logo-text .white-text {
    color: #fff;
}

.mobile-logo-text .blue-text {
    color: var(--primary);
}

.menu-toggle-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 8px;
    transition: background-color 0.2s;
}

.menu-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

/* Sidebar Backdrop for Mobile */
.sidebar-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.sidebar-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    border-right: 1px solid var(--card-border);
    padding: 1.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 999;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.25rem;
    padding: 0 0.25rem;
}

.brand-info {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.brand-logo-svg {
    filter: drop-shadow(0 2px 10px rgba(0, 210, 255, 0.3));
}

.logo-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    line-height: 1.2;
}

.brand-name .white-text {
    color: #fff;
}

.brand-name .blue-text {
    color: var(--primary);
}

.brand-subtitle {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 0.15rem;
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    padding: 0.4rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.close-sidebar-btn:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Sidebar Sections and Navigation */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    overflow-y: auto;
    flex-grow: 1;
    padding-bottom: 1.5rem;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sidebar-nav::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.sidebar-nav {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.65rem;
    letter-spacing: 1.2px;
    font-weight: 600;
    padding-left: 0.75rem;
}

.nav-menu {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.25s ease;
}

.nav-item a i {
    width: 18px;
    height: 18px;
    transition: transform 0.25s ease;
}

.nav-item.active a {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.04);
    box-shadow: inset 0 0 10px rgba(0, 210, 255, 0.03);
    border-left: 3px solid var(--primary);
    padding-left: calc(0.85rem - 3px);
}

.nav-item.active a i {
    color: var(--primary);
}

.nav-item a:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.03);
}

.nav-item a:hover i {
    transform: scale(1.1);
}

/* Credits Floating Widget */
.sidebar-credits-card {
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.4) 0%, rgba(15, 23, 42, 0.4) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 1.15rem;
    margin-top: auto;
    margin-bottom: 1.25rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.credits-title-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.credits-title-wrapper i {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.credits-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 0.35rem;
    letter-spacing: -0.5px;
}

.credits-subtitle {
    font-size: 0.65rem;
    color: var(--text-muted);
}

/* Sidebar Footer */
.sidebar-footer {
    padding-top: 0.75rem;
    border-top: 1px solid var(--card-border);
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem;
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.25s ease;
}

.logout-btn i {
    width: 16px;
    height: 16px;
}

.logout-btn:hover {
    background-color: var(--danger);
    color: #fff;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

/* Main Content Area */
.main-content {
    margin-left: var(--sidebar-width);
    flex-grow: 1;
    padding: 2.5rem;
    min-height: 100vh;
    transition: margin-left 0.3s ease;
}

/* Top Bar */
.topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
}

.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #fff;
    margin-bottom: 0.25rem;
}

.page-title p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Cards & Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.25rem;
}

.stat-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.3);
    border-color: rgba(0, 210, 255, 0.25);
}

.stat-info h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.stat-info .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.1;
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    transition: transform 0.3s;
}

.stat-card:hover .stat-icon {
    transform: scale(1.1);
}

.stat-icon.primary {
    background-color: rgba(0, 210, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(0, 210, 255, 0.15);
}

.stat-icon.secondary {
    background-color: rgba(139, 92, 246, 0.08);
    color: var(--secondary);
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.stat-icon.success {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

/* Sections */
.dashboard-section {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.75rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1.15rem;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    border: none;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.25s ease;
    text-decoration: none;
}

.btn-primary {
    background-color: var(--primary);
    color: #0c0c16;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    box-shadow: 0 0 15px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    border: 1px solid var(--card-border);
}

.btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: var(--text-muted);
}

.btn-success {
    background-color: var(--success);
    color: #fff;
}

.btn-success:hover {
    opacity: 0.95;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.2);
}

.btn-danger {
    background-color: var(--danger);
    color: #fff;
}

.btn-danger:hover {
    opacity: 0.95;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    width: 100%;
    border-radius: 10px;
    border: 1px solid var(--card-border);
}

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

.data-table th, .data-table td {
    padding: 0.85rem 1rem;
}

.data-table th {
    background-color: rgba(255, 255, 255, 0.015);
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1.5px solid var(--card-border);
}

.data-table tbody tr {
    border-bottom: 1px solid var(--card-border);
    transition: background-color 0.2s ease;
}

.data-table tbody tr:last-child {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.015);
}

.data-table td {
    color: var(--text-color);
    font-size: 0.9rem;
    vertical-align: middle;
}

.data-table td code {
    background-color: rgba(255,255,255,0.03);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

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

.form-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.form-control {
    width: 100%;
    background-color: rgba(9, 10, 21, 0.5);
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 0.65rem 0.85rem;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23707e94' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19.5 8.25l-7.5 7.5-7.5-7.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.25rem;
}

/* Log Terminal Style */
.terminal {
    background-color: #040409;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    padding: 1.25rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    color: #00f0ff; /* Light neon blue */
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.8);
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background-color: rgba(0, 210, 255, 0.08);
    color: var(--primary);
    border: 1px solid rgba(0, 210, 255, 0.15);
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.08);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.15);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1050;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    padding: 1.75rem;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

.modal-overlay.active .modal {
    transform: translateY(0);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--card-border);
    padding-bottom: 0.75rem;
}

.modal-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: #fff;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.35rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.05);
}

/* Login Page CSS */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-color);
    padding: 1.25rem;
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.15) 0%, rgba(0,0,0,0) 70%);
    top: -100px;
    right: -100px;
    z-index: 0;
}

.login-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.12) 0%, rgba(0,0,0,0) 70%);
    bottom: -100px;
    left: -100px;
    z-index: 0;
}

.login-card {
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 18px;
    width: 100%;
    max-width: 380px;
    padding: 2.25rem 2rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 10;
}

.login-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.login-header .brand-logo-svg {
    margin: 0 auto 1.15rem;
}

.login-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Alert Notification */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.25rem;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid transparent;
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.15);
    color: var(--danger);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.08);
    border-color: rgba(16, 185, 129, 0.15);
    color: var(--success);
}

/* Responsive Breakpoints */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0) !important;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 10px 0 30px rgba(0,0,0,0.5);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .close-sidebar-btn {
        display: flex;
    }
    
    .mobile-header {
        display: flex;
    }
    
    .main-content {
        margin-left: 0;
        padding: 1.5rem;
        padding-top: calc(64px + 1.5rem);
    }
    
    .topbar {
        margin-bottom: 1.75rem;
    }
    
    .page-title h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .modal {
        width: 95%;
        padding: 1.5rem;
    }
}
