/* Custom Dark Mode Palette & Typography */
@import url('./font.css');

:root {
    --bg-dark: #0f111a;
    --bg-panel: #161925;
    --bg-card: #1e2130;
    --bg-card-hover: #262939;
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --border-color: #2b3040;

    --accent-purple: #8b5cf6;
    --accent-red: #ef4444;
    --accent-blue: #3b82f6;
    --accent-pink: #ec4899;
    --accent-green: #22c55e;
    --accent-orange: #f97316;
    --accent-yellow: #eab308;

    --sidebar-width: 300px;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'HarmonyOS Sans', sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    color: #ffffff;
}

a {
    text-decoration: none;
    color: var(--accent-blue);
    transition: all 0.2s ease;
}

a:hover {
    color: #60a5fa;
}

/* Layout Wrapper */
#wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* Sidebar Styling */
#sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 60px;
    /* Header height */
    left: 0;
    bottom: 0;
    z-index: 1000;
    transition: all 0.3s ease;
}

#sidebar .nav-item {
    margin: 4px 12px;
}

#sidebar .nav-link {
    color: var(--text-main);
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    font-weight: 500;
    transition: all 0.2s;
}

#sidebar .nav-link i.fa {
    width: 24px;
    font-size: 1.1rem;
    text-align: center;
    margin-right: 12px;
    color: var(--accent-blue);
}

#sidebar .nav-link:hover,
#sidebar .nav-link.active {
    background-color: var(--bg-card);
    color: #ffffff;
}

/* Status Box in Sidebar */
.companion-status-box {
    margin: auto 12px 16px 12px;
    /* Push to bottom */
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.companion-status-header {
    background-color: var(--accent-blue);
    color: #fff;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.companion-status-header i {
    margin-right: 8px;
}

.companion-status-body {
    padding: 15px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.companion-status-body h6 {
    font-size: 0.9rem;
    margin-bottom: 8px;
    color: var(--text-main);
}

.status-indicator {
    color: var(--accent-red);
    font-weight: 600;
    margin-bottom: 12px;
    display: inline-block;
}

/* Top Navigation */
#top-header {
    height: 60px;
    background-color: var(--bg-panel);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1050;
}

.logo-area {
    display: flex;
    align-items: center;
    width: var(--sidebar-width);
}

.logo-area img {
    height: 35px;
}

#sidebar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 1.5rem;
    cursor: pointer;
}

.user-profile {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-profile img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin-right: 10px;
}

.user-profile .dropdown-menu {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    margin-top: 10px;
}

.dropdown-item {
    color: var(--text-main);
    padding: 10px 20px;
}

.dropdown-item:hover {
    background-color: var(--bg-card-hover);
    color: #fff;
}

/* Main Content Area */
#main-content {
    flex-grow: 1;
    margin-left: var(--sidebar-width);
    margin-top: 60px;
    /* Header height */
    padding: 24px;
    transition: all 0.3s ease;
    min-height: calc(100vh - 60px);
    min-width: 0;
}

/* Panels and Cards */
.panel {
    background-color: var(--bg-panel);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
}

.panel-header h5 {
    margin: 0;
    font-size: 1.1rem;
}

.panel-body {
    padding: 20px;
}

/* Stat Cards (Dashboard & Email Grids) */
.stat-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid var(--border-color);
    height: 100%;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 28px;
    color: #fff;
    margin-right: 20px;
    flex-shrink: 0;
}

.stat-content .stat-value {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 4px;
}

.stat-content .stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* Color Themes for Stat Cards */
.bg-purple {
    background-color: var(--accent-purple);
}

.bg-red {
    background-color: var(--accent-red);
}

.bg-blue {
    background-color: var(--accent-blue);
}

.bg-pink {
    background-color: var(--accent-pink);
}

.bg-green {
    background-color: var(--accent-green);
}

.bg-orange {
    background-color: var(--accent-orange);
}

.bg-yellow {
    background-color: var(--accent-yellow);
    color: #000;
}

/* text black for yellow */

/* Special Icons for Email Status */
.status-icon-circle {
    width: 32px;
    height: 32px;
    border: 2px solid white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    font-weight: bold;
}

/* Server Info List */
.server-info-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.server-info-list li {
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-start;
}

.server-info-list li:last-child {
    border-bottom: none;
}

.server-info-list li span:first-child {
    color: var(--text-muted);
    margin-right: 8px;
}

.pagination>button {
    border-radius: 0;
}

.pagination>button:first-child {
    border-radius: 5px 0 0 5px;
}

.pagination>button:last-child {
    border-radius: 0 5px 5px 0;
}

.pagination>input {
    border-radius: 0;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    #sidebar {
        transform: translateX(-100%);
    }

    #sidebar.show {
        transform: translateX(0);
        width: 100%;
        /* Full screen sidebar on mobile */
    }

    #main-content {
        margin-left: 0;
    }

    #sidebar-toggle {
        display: block;
    }

    .logo-area {
        width: auto;
    }

    .mobile-hide {
        display: none !important;
    }
}