﻿@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --bg-dark: #0b1120;
    /* Darker base */
    --sidebar-bg: rgba(11, 17, 32, 0.65);
    /* Glassy sidebar */
    --card-bg: rgba(20, 30, 50, 0.6);
    /* Glassy cards */
    --text-primary: #ffffff;
    --text-secondary: #a0aec0;
    --accent-green: #00ff9d;
    /* Brighter neon green */
    --accent-blue: #4318ff;
    --border-color: rgba(255, 255, 255, 0.08);
    --hover-bg: rgba(255, 255, 255, 0.1);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.bg-glass {
    background-color: var(--card-bg) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
}

body {
    background-color: var(--bg-dark);
    background-image: url('../images/login-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-primary);
    font-family: 'Plus Jakarta Sans', sans-serif;
    margin: 0;
    overflow-x: hidden;
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 80px;
    /* Collapsed width */
    background-color: var(--sidebar-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 20px 10px;
    /* Reduced padding */
    border-right: var(--glass-border);
    z-index: 1030;
    /* Higher than topbar to sit on top/left */
    box-shadow: 5px 0 30px rgba(0, 0, 0, 0.2);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    white-space: nowrap;
}

.sidebar:hover {
    width: 260px;
    /* Expanded width */
    padding: 20px;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 40px;
    padding-left: 0;
    justify-content: center;
    height: 60px;
    /* Increased height */
    overflow: hidden;
    transition: all 0.3s ease;
}

.sidebar:hover .brand-logo {
    padding-left: 20px;
    justify-content: flex-start;
    width: 100%;
}

.logo-sm {
    height: 45px;
    /* Increased size for icon */
    width: auto;
    display: block;
}

.logo-lg {
    height: 45px;
    /* Increased size */
    width: auto;
    display: none;
}

.sidebar:hover .logo-sm {
    display: none;
}

.sidebar:hover .logo-lg {
    display: block;
    animation: fadeIn 0.3s;
}

/* Cleanup old classes */
.logo-img,
.brand-text,
.logo-icon {
    display: none;
}

.link-text {
    display: none;
}

.sidebar:hover .link-text {
    display: inline;
    white-space: nowrap;
    animation: fadeIn 0.2s;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin-bottom: 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: rgba(255, 255, 255, 0.7);
    /* White with opacity to behave like 'text-secondary' but look white */
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
    justify-content: center;
    /* Center icons when collapsed */
}

.sidebar:hover .nav-link {
    justify-content: flex-start;
    /* Left align when expanded */
}

.nav-link:hover,
.nav-link.active {
    background-color: var(--hover-bg);
    color: #ffffff;
    opacity: 1;
}

.nav-link i {
    font-size: 1.2rem;
    min-width: 24px;
    text-align: center;
    margin-right: 0;
    /* Remove margin when collapsed */
}

.sidebar:hover .nav-link i {
    margin-right: 15px;
    /* Restore margin when expanded */
}

/* btn-dashboard styles removed */

/* Main Content */
.main-content {
    margin-left: 80px;
    /* Match collapsed width */
    padding: 0;
    /* Removed padding to allow full-width top-bar */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* If you want Content to NOT move when sidebar expands (overlay mode), 
   just keep margin-left 80px. If you want it to push, use:
   .sidebar:hover ~ .main-content { margin-left: 260px; } 
   But "Overlay" is better for "Screen Real Estate" feeling.
   We will stick to margin-left: 80px permanent.
*/

.bg-solid-dark {
    background-color: #242526 !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

/* Header/Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    /* Removed margin-bottom */
    background-color: rgba(11, 17, 32, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 1040;
    padding: 15px 30px;
    width: 100%;
}

.search-bar {
    background: #3a3b3c;
    border: none;
    border-radius: 50px;
    padding: 0 15px;
    height: 40px;
    display: flex;
    align-items: center;
    width: 280px;
    transition: all 0.2s ease;
}

.search-bar:focus-within {
    background: #3a3b3c;
    box-shadow: none;
}

.search-bar input {
    background: transparent;
    border: none;
    color: #e4e6eb;
    width: 100%;
    margin-left: 8px;
    height: 100%;
    font-size: 0.95rem;
}

.search-bar i {
    color: #b0b3b8;
    font-size: 1rem;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Dashboard Cards */
.stat-card {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
    /* Slightly smaller radius */
    padding: 15px;
    /* Reduced padding from 20px */
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    transition: transform 0.3s ease, background 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    background-color: rgba(30, 40, 70, 0.7);
    border-color: rgba(0, 255, 157, 0.3);
}

.stat-icon {
    width: 40px;
    /* Reduced from 50px */
    height: 40px;
    /* Reduced from 50px */
    border-radius: 10px;
    /* Soft square like image */
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-green);
    font-size: 1.1rem;
    /* Reduced font size */
}

.stat-info h3 {
    margin: 0;
    font-size: 1.4rem;
    /* Reduced from 1.8rem */
    font-weight: 700;
    letter-spacing: -0.5px;
}

.stat-info p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.trend-badge {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 10px;
}

.trend-up {
    background-color: rgba(0, 255, 157, 0.15);
    color: var(--accent-green);
    border: 1px solid rgba(0, 255, 157, 0.2);
}

.trend-down {
    background-color: rgba(255, 91, 91, 0.15);
    color: #ff5b5b;
    border: 1px solid rgba(255, 91, 91, 0.2);
}

/* Charts */
.chart-container {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    height: 100%;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Tables */
.table-container {
    background-color: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 20px;
    padding: 30px;
    /* More padding like image */
}

.custom-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.custom-table th {
    text-align: left;
    color: var(--text-secondary);
    padding: 15px 20px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

.custom-table td {
    padding: 20px;
    color: var(--text-primary);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    vertical-align: middle;
}

.custom-table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.custom-table tr:last-child td {
    border-bottom: none;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.badge-status {
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 600;
    border: 1px solid rgba(0, 255, 157, 0.3);
    color: #fff;
    background: rgba(0, 255, 157, 0.1);
    text-transform: capitalize;
}

/* --- LOGIN PAGE STYLES (Restored) --- */
.login-body-design {
    min-height: 100vh;
    width: 100vw;
    position: relative;
    display: flex;
    flex-direction: column;
    background-image: url('../images/login-bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

.design-overlay {
    background: rgba(5, 10, 20, 0.4);
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

.content-container {
    display: flex;
    width: 100%;
    max-width: 1400px;
    padding: 40px;
    justify-content: space-between;
    align-items: center;
}

.info-section {
    flex: 1;
    padding-right: 80px;
    padding-left: 50px;
    max-width: 600px;
}

/* Brand header for login (different from sidebar) */
.info-section .brand-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
}

.brand-logo-box {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    color: #00ff00;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.2);
}

.brand-name {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.8rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 1px;
}

.brand-name span {
    color: #00ff00;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 600;
    line-height: 1.1;
    margin-bottom: 20px;
    background: linear-gradient(90deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: #8f9bb3;
    line-height: 1.6;
    margin-bottom: 50px;
}

.status-cards {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 60px;
}

.status-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 15px 25px;
    width: fit-content;
    min-width: 280px;
}

.status-card .status-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-right: 15px;
}

.status-card .status-icon.success {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
}

.status-card .status-icon.secure {
    background: rgba(0, 255, 0, 0.05);
    color: #00ffba;
}

.status-text {
    display: flex;
    flex-direction: column;
}

.status-label {
    font-size: 0.85rem;
    color: #8f9bb3;
    margin-bottom: 2px;
}

.status-value {
    font-size: 1rem;
    color: #fff;
    font-weight: 500;
}

.site-copyright {
    color: #555;
    font-size: 0.9rem;
}

.form-section {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.glass-login-card {
    width: 400px;
    background: rgba(20, 30, 40, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    position: relative;
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.card-glow-effect {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(0, 255, 0, 0.4) 0%, rgba(0, 0, 0, 0) 70%);
    filter: blur(20px);
    z-index: 0;
}

.card-brand {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
}

.card-brand-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
}

.card-brand-text span {
    color: #00ff00;
}

.star-icon {
    opacity: 0.8;
}

.form-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #ccc;
    margin-bottom: 30px;
}

.input-group {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: #ccc;
    font-weight: 500;
}

.design-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #333;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
    box-sizing: border-box;
    transition: all 0.3s;
}

.design-input:focus {
    outline: none;
    border-color: #00ff00;
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(0, 255, 0, 0.1);
}

.password-wrapper {
    position: relative;
}

.show-password {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: #888;
    cursor: pointer;
    letter-spacing: 0.5px;
}

.show-password:hover {
    color: #fff;
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    font-size: 0.9rem;
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #aaa;
    user-select: none;
}

.checkbox-container input {
    accent-color: #00ff00;
}

.forgot-link {
    color: #aaa;
    text-decoration: none;
}

.forgot-link:hover {
    color: #fff;
}

.btn-design-login {
    width: 100%;
    padding: 16px;
    background: linear-gradient(90deg, #113322, #00ff00 150%);
    background-size: 200% auto;
    color: #fff;
    border: 1px solid rgba(0, 255, 0, 0.3);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 5px 15px rgba(0, 255, 0, 0.15);
    transition: all 0.3s ease;
    text-align: center;
}

.btn-design-login:hover {
    box-shadow: 0 5px 25px rgba(0, 255, 0, 0.3);
    border-color: #00ff00;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

.login-tip {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #666;
    text-align: center;
}

.card-copyright {
    margin-top: 40px;
    text-align: center;
    font-size: 0.8rem;
    color: #444;
}

.text-danger {
    color: #ff5555;
    font-size: 0.85rem;
    margin-top: 5px;
}

/* Responsive adjustments for Login */
@media (max-width: 1000px) {
    .login-body-design .content-container {
        flex-direction: column-reverse;
        justify-content: center;
        gap: 50px;
        padding-top: 20px;
    }

    .login-body-design .info-section {
        padding-right: 0;
        text-align: center;
        max-width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .info-section .brand-header {
        justify-content: center;
    }
}

/* =========================================
   Global Search Results Dropdown
   ========================================= */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #1a1f37;
    /* High opacity to hide background */
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 10000;
    margin-top: 10px;
    overflow: hidden;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    /* Hidden by default */
}

.search-results-dropdown.show {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    cursor: pointer;
    background: transparent;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover,
.search-result-item.active {
    background-color: rgba(0, 255, 157, 0.1);
    padding-left: 20px;
    color: #fff;
}

.search-result-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    color: var(--accent-green);
    font-size: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.search-result-info {
    display: flex;
    flex-direction: column;
}

.search-result-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.search-result-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.no-results {
    padding: 30px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* --- Responsive Sidebar & Layout --- */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 950;
    display: none;
    backdrop-filter: blur(4px);
}

.sidebar-overlay.active {
    display: block;
}

.mobile-toggle-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    margin-right: 15px;
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 0;
    }

    .top-bar {
        /* No negative margins to reset */
        padding: 15px;
    }

    .content-wrapper {
        padding: 15px !important;
    }

    .search-bar {
        width: 100%;
        /* Expand search on small screens if needed, or hide */
        display: none;
        /* Often better to hide or toggle search on very small screens, or keep simplistic */
    }

    .search-bar.mobile-visible {
        display: flex;
        position: absolute;
        top: 70px;
        left: 15px;
        right: 15px;
        width: auto;
        z-index: 890;
    }

    .user-profile {
        gap: 10px;
    }

    /* Adjust grid columns for stats on mobile */
    .col-md-4,
    .col-md-6 {
        width: 100%;
    }
}

/* Remove outlines from everything on click/focus */
button:focus,
button:active,
.btn:focus,
.btn:active,
.btn:focus-visible,
input:focus,
input:active,
select:focus,
textarea:focus,
.form-control:focus,
.form-select:focus,
.dropdown-toggle:focus,
.dropdown-item:focus,
a:focus,
*[tabindex]:focus {
    outline: none !important;
    box-shadow: none !important;
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Chat Head Mode */
.chat-popup.chat-head-mode {
    width: 60px !important;
    height: 60px !important;
    border-radius: 50% !important;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3) !important;
    transition: all 0.3s ease;
    background: transparent !important;
    border: none !important;
}

.chat-popup.chat-head-mode .chat-popup-header {
    padding: 0 !important;
    height: 100% !important;
    background: transparent !important;
    justify-content: center !important;
    border: none !important;
    box-shadow: none !important;
}

.chat-popup.chat-head-mode .chat-popup-body,
.chat-popup.chat-head-mode .chat-popup-footer,
.chat-popup.chat-head-mode .btn,
.chat-popup.chat-head-mode h6,
.chat-popup.chat-head-mode small {
    display: none !important;
}

.chat-popup.chat-head-mode .chat-popup-header .d-flex.align-items-center.gap-2 {
    margin: 0 !important;
    width: 100%;
    height: 100%;
    justify-content: center;
}

.chat-popup.chat-head-mode img {
    width: 50px !important;
    height: 50px !important;
    border: 2px solid #00ff00;
}


.chat-popup.chat-head-mode .position-relative span.bg-success {
    display: none;
}

/* Close Button on Chat Head */
.chat-popup.chat-head-mode .chat-head-close-btn {
    display: flex !important;
    background: rgba(80, 80, 80, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    transition: all 0.2s;
}

.chat-popup.chat-head-mode .chat-head-close-btn:hover {
    background: #ff4444 !important;
    border-color: #ff4444 !important;
    transform: scale(1.1);
}

.chat-popup:not(.chat-head-mode) .chat-head-close-btn {
    display: none !important;
}