/* ========================================
   ImhotepX Dashboard - SaaS Layout Styles
   ======================================== */

:root {
    --primary-color: #1e40af;
    --primary-hover: #1e3a8a;
    --sidebar-bg: #1f2937;
    --sidebar-hover: #374151;
    --header-bg: #ffffff;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: #f9fafb;
    min-height: 100vh;
}

/* ========================================
   Layout Structure
   ======================================== */

.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* ========================================
   Sidebar Navigation
   ======================================== */

.sidebar {
    width: 260px;
    background-color: var(--sidebar-bg);
    color: white;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    z-index: 100;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transition: transform 0.3s ease;
}

.sidebar-logo {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo img {
    height: 40px;
    width: auto;
}

.sidebar-logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-section-title {
    padding: 1rem 1.5rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
}

.nav-item {
    display: block;
    padding: 0.75rem 1.5rem;
    color: #d1d5db;
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-item:hover {
    background-color: var(--sidebar-hover);
    color: white;
    text-decoration: none;
}

.nav-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: #60a5fa;
    border-left-color: #60a5fa;
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
}

/* ========================================
   Main Content Area
   ======================================== */

.main-content {
    flex: 1;
    margin-left: 260px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ========================================
   Header
   ======================================== */

.dashboard-header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* ========================================
   User Profile Dropdown
   ======================================== */

.user-profile {
    position: relative;
}

.user-profile-button {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-profile-button:hover {
    background-color: #f3f4f6;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.2;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.2;
}

.dropdown-icon {
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.user-profile-button.active .dropdown-icon {
    transform: rotate(180deg);
}

/* ========================================
   Dropdown Menu
   ======================================== */

.dropdown-menu {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    min-width: 200px;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-header-name {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.dropdown-header-email {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: #f3f4f6;
    text-decoration: none;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    color: var(--text-secondary);
}

.dropdown-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 0.5rem 0;
}

.dropdown-item.logout {
    color: #dc2626;
}

.dropdown-item.logout i {
    color: #dc2626;
}

/* ========================================
   Content Area
   ======================================== */

.content-wrapper {
    flex: 1;
    padding: 2rem;
}

.content-container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-menu-toggle {
        display: block;
    }
}

@media (max-width: 640px) {
    .dashboard-header {
        padding: 0 1rem;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .user-info {
        display: none;
    }

    .sidebar {
        width: 100%;
    }
}

/* ========================================
   Mobile Menu Toggle
   ======================================== */

.mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: var(--text-primary);
    font-size: 1.5rem;
}

@media (max-width: 1024px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* ========================================
   Backdrop for mobile menu
   ======================================== */

.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 90;
}

.sidebar-backdrop.show {
    display: block;
}

/* ========================================
   Utility Classes
   ======================================== */

.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background-color: #fee2e2;
    color: #991b1b;
}
