/* ================================================================
   infocyn — Layout CSS
   Sidebar: LEFT | Dashboard: Headerless full-screen terminal
   ================================================================ */

/* ─── Header (Public Pages Only) ─────────────────────────────── */
header, .public-header {
    background: rgba(10, 11, 16, 0.88) !important;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    height: var(--header-height);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 30px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6);
    border-bottom: 1px solid rgba(0, 255, 251, 0.25);
}

/* Hide header completely inside dashboard layout */
body.layout-dashboard header,
body.layout-dashboard .public-header {
    display: none !important;
}

/* ─── Mobile Hamburger Toggle & Drawer ───────────────────────── */
.mobile-hamburger-btn,
.mobile-menu-toggle,
.menu-toggle {
    display: none;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--primary-color) !important;
    font-size: 1.4rem !important;
    padding: 6px 8px !important;
    cursor: pointer !important;
    transition: transform 0.2s ease !important;
}

.mobile-hamburger-btn:hover,
.mobile-menu-toggle:hover,
.menu-toggle:hover,
.mobile-hamburger-btn:active,
.mobile-menu-toggle:active,
.menu-toggle:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: scale(1.1) !important;
}

.mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 7, 12, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 1100;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s ease, visibility 0.28s ease;
}

.mobile-nav-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    left: auto;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    background: linear-gradient(180deg, rgba(14, 18, 28, 0.98) 0%, rgba(8, 10, 16, 0.99) 100%);
    border-left: 1px solid rgba(0, 255, 251, 0.3);
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.7);
    z-index: 1200;
    transform: translateX(100%);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    backdrop-filter: blur(16px);
}

.mobile-nav-drawer.active {
    transform: translateX(0);
}

.mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(0, 255, 251, 0.18);
}

.mobile-nav-close-btn {
    background: transparent;
    border: 1px solid rgba(255, 0, 85, 0.35);
    color: #ff0055;
    font-size: 18px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mobile-nav-close-btn:hover {
    background: rgba(255, 0, 85, 0.15);
    border-color: #ff0055;
    transform: rotate(90deg);
}

.mobile-nav-body {
    padding: 20px 18px;
    flex: 1;
    overflow-y: auto;
    scrollbar-width: thin;
}

.mobile-user-profile-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(0, 255, 251, 0.06);
    border: 1px solid rgba(0, 255, 251, 0.2);
    border-radius: 10px;
    margin-bottom: 20px;
}

.mobile-user-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--primary-color);
}

.mobile-user-info {
    display: flex;
    flex-direction: column;
}

.mobile-user-name {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 0.95rem;
}

.mobile-user-role {
    font-size: 0.75rem;
    color: rgba(224, 224, 224, 0.6);
}

.mobile-nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mobile-menu-divider {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(0, 255, 251, 0.6);
    font-weight: 700;
    margin: 14px 0 6px 6px;
}

.mobile-nav-menu li a {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 52px;
    padding: 0 18px;
    border-radius: 10px;
    color: rgba(224, 224, 224, 0.85);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid transparent;
    transition: all 0.22s ease;
}

.mobile-nav-menu li a i {
    font-size: 18px;
    color: var(--primary-color);
    width: 22px;
    text-align: center;
}

.mobile-nav-menu li.active a,
.mobile-nav-menu li a:hover {
    background: rgba(0, 255, 251, 0.1);
    color: #ffffff;
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(0, 255, 251, 0.2);
}

.mobile-nav-menu li.active a i,
.mobile-nav-menu li a:hover i {
    color: var(--primary-color);
    text-shadow: 0 0 8px var(--primary-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo i { color: var(--primary-color); font-size: 28px; }
.logo h1 {
    color: var(--primary-color);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 1px;
    text-shadow: 0 0 10px rgba(0, 255, 251, 0.3);
    font-family: "Orbitron", sans-serif;
}

.bat-icon {
    color: var(--primary-color);
    font-size: 22px;
    margin-left: 10px;
    animation: fly 5s infinite ease-in-out;
}

@keyframes fly {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    25%  { transform: translateY(-5px) rotate(5deg); }
    50%  { transform: translateY(0) rotate(0deg); }
    75%  { transform: translateY(5px) rotate(-5deg); }
}

/* ─── Navigation ──────────────────────────────────────────────── */
nav { display: flex; align-items: center; }

.nav-links {
    display: flex;
    list-style: none;
    gap: 25px;
}

.nav-links li { position: relative; }

.nav-links a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-links a:hover { color: var(--primary-color); }
.nav-links a i { font-size: 14px; }

/* Dropdown */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: var(--secondary-color);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.8);
    list-style: none;
    padding: 10px 0;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    z-index: 1100;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -10px; right: 20px;
    width: 0; height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-bottom: 10px solid var(--secondary-color);
}

.dropdown-menu li { padding: 10px 20px; transition: all 0.3s ease; }
.dropdown-menu li:hover { background-color: rgba(0, 255, 251, 0.1); }
.dropdown-menu a { color: var(--text-color); font-size: 15px; white-space: nowrap; display: flex; align-items: center; gap: 8px; }
.nav-links li:hover .dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.menu-toggle, .mobile-menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 24px;
    color: var(--primary-color);
}

/* ─── Main Content (Public Pages) ─────────────────────────────── */
main {
    flex: 1;
    padding-top: calc(var(--header-height) + 30px);
    padding-bottom: 40px;
    padding-left: 30px;
    padding-right: 30px;
    width: 100%;
    box-sizing: border-box;
}

/* Dashboard root grid layout */
.dashboard-root {
    display: grid;
    grid-template-columns: var(--sidebar-width) 1fr;
    grid-template-areas: "sidebar main";
    min-height: 100vh;
}

/* Main content area inside dashboard layout */
.main-content {
    grid-area: main;
    padding: calc(var(--header-height) + 30px) 30px var(--footer-height);
    width: 100%;
    overflow-x: hidden;
}

/* ─── Footer ──────────────────────────────────────────────────── */
footer {
    background-color: var(--secondary-color);
    color: var(--text-color);
    padding: 20px 30px;
    text-align: center;
    min-height: var(--footer-height);
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid rgba(0, 255, 251, 0.2);
    margin-top: auto;
    width: 100%;
    position: relative;
    z-index: 100;
}

footer p { font-size: 14px; }
footer a { color: var(--primary-color); text-decoration: none; transition: all 0.3s ease; }
footer a:hover { text-shadow: 0 0 10px rgba(0, 255, 251, 0.5); }

/* ================================================================
   SIDEBAR — LEFT SIDE (Dashboard & Admin)
   ================================================================ */
.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #0a0e17 0%, #0d1220 50%, #080c14 100%);
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    border-right: 1px solid rgba(0, 255, 251, 0.15);
    box-shadow: 4px 0 30px rgba(0, 0, 0, 0.5);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 200;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 251, 0.2) transparent;
}

/* Collapsible behavior */
.sidebar.collapsed {
    transform: translateX(-100%);
}
.sidebar-toggle {
    display: none;
    position: absolute;
    top: 15px;
    right: -40px;
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 1.2rem;
}
@media (max-width: 1023px) {
    .sidebar-toggle { display: block; }
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(0, 255, 251, 0.2); border-radius: 4px; }

/* Sidebar brand bar at top */
.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 22px;
    border-bottom: 1px solid rgba(0, 255, 251, 0.1);
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
    text-shadow: 0 0 12px rgba(0, 255, 251, 0.4);
    text-decoration: none;
    letter-spacing: 1px;
}

.sidebar-brand i { font-size: 1.4rem; }

/* Return to site button */
.sidebar-home-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 16px;
    padding: 9px 14px;
    border: 1px solid rgba(0, 255, 251, 0.3);
    border-radius: 8px;
    background: rgba(0, 255, 251, 0.05);
    color: var(--text-color);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.25s ease;
    font-weight: 500;
}

.sidebar-home-btn:hover {
    background: rgba(0, 255, 251, 0.12);
    color: var(--primary-color);
    border-color: var(--primary-color);
}

/* User profile card in sidebar */
.sidebar-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(0, 255, 251, 0.08);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 13px;
}

.user-avatar-wrap { position: relative; flex-shrink: 0; }

.user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid var(--primary-color);
    object-fit: cover;
    box-shadow: 0 0 12px rgba(0, 255, 251, 0.3);
}

.online-dot {
    position: absolute;
    bottom: 1px; right: 1px;
    width: 11px; height: 11px;
    background: #00e676;
    border: 2px solid #0a0e17;
    border-radius: 50%;
}

.user-info { flex: 1; min-width: 0; }

.user-name {
    color: var(--primary-color);
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 0.73rem;
    color: rgba(255,255,255,0.45);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Sidebar menu */
.sidebar-menu { padding: 10px 0 30px; }

.menu-category {
    color: rgba(0, 255, 251, 0.5);
    padding: 14px 22px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 18px;
    color: rgba(255,255,255,0.65);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    margin: 1px 0;
    border-radius: 0 8px 8px 0;
}

.menu-item i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem !important;
    flex-shrink: 0;
}

/* Sidebar Menu Items Desktop Font Size Optimization */
@media (min-width: 992px) {
    .menu-item {
        font-size: 0.78rem !important;
        padding: 7px 16px !important;
    }
    .menu-item i {
        font-size: 0.92rem !important;
    }
    .menu-category {
        font-size: 0.62rem !important;
        padding: 10px 16px 4px !important;
        letter-spacing: 1.5px !important;
    }
    .user-name {
        font-size: 0.82rem !important;
    }
    .user-email {
        font-size: 0.65rem !important;
    }
}

.menu-item:hover {
    background: rgba(0, 255, 251, 0.07);
    color: var(--primary-color);
    border-left-color: rgba(0, 255, 251, 0.5);
}

.menu-item.active {
    background: rgba(0, 255, 251, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 600;
}

.menu-item.danger {
    color: rgba(255, 80, 80, 0.7);
}

.menu-item.danger:hover {
    background: rgba(255, 60, 60, 0.08);
    color: #ff5050;
    border-left-color: #ff5050;
}

/* ─── Main Content (Dashboard) ────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-width);    /* ← LEFT offset */
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 32px 36px 0;
    transition: margin-left 0.35s ease;
    background: transparent;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
}

.main-content-inner {
    flex: 1 0 auto;
    width: 100%;
    min-width: 0;
    max-width: 100%;
}

/* When sidebar is collapsed, remove left margin */
.sidebar.collapsed ~ .main-content {
    margin-left: 0;
}


/* ─── Dashboard Mobile Top Bar ────────────────────────────────── */
.dashboard-mobile-bar {
    display: none;
    background: linear-gradient(90deg, #0a0e17, #0d1a30);
    padding: 13px 18px;
    border-bottom: 1px solid rgba(0, 255, 251, 0.2);
    position: sticky;
    top: 0;
    z-index: 150;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 15px rgba(0,0,0,0.5);
}

.dashboard-brand-title {
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1rem;
    text-shadow: 0 0 8px rgba(0, 255, 251, 0.4);
}

/* Sidebar Toggle Button for Dashboard Mobile Bar (Borderless Icon) */
.sidebar-toggle-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    padding: 6px 8px !important;
    cursor: pointer !important;
    color: var(--primary-color) !important;
    transition: transform 0.2s ease !important;
}

.sidebar-toggle-btn:hover,
.sidebar-toggle-btn:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: scale(1.1) !important;
}

.sidebar-toggle-btn i {
    font-size: 1.4rem !important;
    color: var(--primary-color) !important;
    display: inline-block !important;
    visibility: visible !important;
}

.sidebar-toggle-btn.admin-toggle-btn {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffa500 !important;
}

.sidebar-toggle-btn.admin-toggle-btn:hover,
.sidebar-toggle-btn.admin-toggle-btn:active {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

.sidebar-toggle-btn.admin-toggle-btn i {
    color: #ffa500 !important;
}

/* ─── Dashboard Page Header ───────────────────────────────────── */
.page-header {
    margin-bottom: 28px;
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(0, 255, 251, 0.1);
}

.page-header h2 {
    font-family: "Orbitron", sans-serif;
    font-size: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 4px;
}

.page-header p {
    color: rgba(255,255,255,0.45);
    font-size: 0.87rem;
}

/* ─── Dashboard Stat Cards ────────────────────────────────────── */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.dashboard-card {
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.dashboard-card {
    background: linear-gradient(135deg, rgba(13, 18, 32, 0.9) 0%, rgba(8, 12, 20, 0.95) 100%);
    border: 1px solid rgba(0, 255, 251, 0.15);
    border-radius: 14px;
    padding: 22px 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dashboard-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    opacity: 0.6;
}

.dashboard-card:hover {
    border-color: rgba(0, 255, 251, 0.35);
    box-shadow: 0 8px 30px rgba(0, 255, 251, 0.08);
    transform: translateY(-2px);
}

.card-title {
    color: rgba(255,255,255,0.55);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.card-title i { color: var(--primary-color); font-size: 1rem; }

.card-value {
    font-size: 2.2rem;
    font-weight: 800;
    color: #fff;
    font-family: "Orbitron", sans-serif;
    line-height: 1;
    margin-bottom: 8px;
}

.card-change {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.35);
}
