/* header.css - Common styles for Admin, Patient, and Clinician portals */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #1e3c72 50%, #2a5298 10%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --light-bg: #f8f9fa;
    --border-color: #e9ecef;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --sidebar-width: 250px;
    --sidebar-collapsed: 70px;
    --top-nav-height: 56px;
}

/* Base body styles */
body {
    font-size: 14px;
    overflow-x: hidden;
    padding-top: 80px !important; /* Increased for fixed navbar */
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8fafc;
    color: #334155;
}

/* Navbar specific styles */
nav {
    background: var(--secondary-gradient) !important;
    color: white;
}

.navbar {
    background: var(--secondary-gradient);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-height: 80px;
}

.navbar-brand {
    font-weight: 600;
    padding: 0.5rem;
}

.brand-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: white;
}

.brand-subtitle {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.9);
}

/* Navbar links */
.navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9) !important;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: all 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* User avatar */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    flex-shrink: 0;
}

.user-name-small {
    font-weight: 600;
    color: white;
}

.user-role-small {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Book appointment button */
.btn-appointment {
    background: linear-gradient(135deg, #0d9488 0%, #0d9488 100%);
    border: none;
    color: white;
    padding: 8px 20px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-appointment:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(13, 148, 136, 0.3);
    color: white;
}

/* Desktop breadcrumb */
.desktop-breadcrumb-container {
    flex: 1;
    display: flex;
    justify-content: center;
    margin: 0 0.75rem;
}

.desktop-breadcrumb {
    margin: 0;
    display: flex;
    align-items: center;
}

.desktop-breadcrumb .breadcrumb {
    margin: 0;
    background: transparent;
    padding: 0;
    font-size: 0.9rem;
}

/* Mobile specific styles */
@media (max-width: 991.98px) {
    body {
        padding-top: 70px !important;
    }
    
    .navbar {
        min-height: 70px;
        padding: 0.5rem 1rem;
    }
    
    /* Ensure navbar collapse menu is properly positioned */
    .navbar-collapse {
        position: fixed !important;
        top: 70px !important;
        left: 0 !important;
        right: 0 !important;
        background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%) !important;
        z-index: 9998 !important;
        max-height: calc(100vh - 70px) !important;
        overflow-y: auto !important;
        padding: 1rem !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
        transition: all 0.3s ease !important;
    }
    
    .navbar-collapse:not(.show) {
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px);
    }
    
    .navbar-collapse.show {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
    
    /* Nav items for mobile */
    .navbar-nav {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .nav-item {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .nav-link {
        padding: 12px 15px !important;
        color: white !important;
        border-radius: 6px;
        display: flex;
        align-items: center;
        width: 100%;
    }
    
    .nav-link:hover,
    .nav-link.active {
        background-color: rgba(255, 255, 255, 0.15) !important;
    }
    
    /* User dropdown for mobile */
    .user-dropdown {
        width: 100%;
    }
    
    .user-dropdown .dropdown-toggle {
        width: 100%;
        justify-content: flex-start;
        padding: 12px 15px !important;
    }
    
    .user-dropdown .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 5px;
        background-color: rgba(255, 255, 255, 0.95);
        border: none;
        box-shadow: none;
    }
    
    .user-dropdown .dropdown-item {
        color: #333;
        padding: 10px 15px;
    }
    
    /* Button adjustments for mobile */
    .btn-appointment {
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }
    
    /* Logo adjustments */
    .logo-container {
        height: 50px !important;
    }
    
    .navbar-logo {
        height: 45px !important;
        width: auto !important;
    }
    
    .brand-text {
        display: none !important;
    }
    
    /* Ensure hero section has proper margin on mobile */
    .hero-section {
        margin-top: 10px !important;
        padding-top: 30px !important;
    }
}

/* Extra small devices */
@media (max-width: 576px) {
    body {
        padding-top: 65px !important;
    }
    
    .navbar {
        min-height: 65px;
        padding: 0.5rem;
    }
    
    .navbar-collapse {
        top: 65px !important;
        max-height: calc(100vh - 65px) !important;
    }
    
    .nav-link {
        padding: 10px 12px !important;
        font-size: 15px;
    }
    
    .logo-container {
        height: 45px !important;
    }
    
    .navbar-logo {
        height: 40px !important;
    }
}

/* Sidebar Styles (for portals) */
.sidebar {
    position: fixed;
    top: var(--top-nav-height);
    bottom: 0;
    left: 0;
    z-index: 1030;
    width: var(--sidebar-width);
    transition: all 0.3s;
    background: linear-gradient(180deg, #2c3e50 0%, #1a2530 100%);
    overflow-y: auto;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-sticky {
    position: relative;
    height: calc(100vh - var(--top-nav-height));
    padding-top: .5rem;
    overflow-x: hidden;
    overflow-y: auto;
}

.sidebar .nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.375rem;
    margin: 0.125rem 1rem;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    white-space: nowrap;
}

.sidebar.collapsed .nav-link {
    padding: 0.75rem;
    margin: 0.125rem 0.5rem;
    justify-content: center;
}

.sidebar.collapsed .nav-link span,
.sidebar.collapsed .badge {
    display: none !important;
}

.sidebar.collapsed .sidebar-heading {
    display: none;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
}

.sidebar .nav-link.active {
    color: white;
    background-color: rgba(255, 255, 255, 0.15);
    border-left: 4px solid var(--primary-color);
}

.sidebar.collapsed .nav-link.active {
    border-left: 4px solid transparent;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    margin: 0.125rem auto;
}

.sidebar .nav-link i {
    width: 20px;
    text-align: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.sidebar-heading {
    font-size: .75rem;
    text-transform: uppercase;
    padding: 0.5rem 1rem;
    margin-top: 1rem;
    color: rgba(255, 255, 255, 0.5);
    font-weight: 600;
    letter-spacing: 1px;
}

/* Main Content Area (for portals) */
.main-content {
    margin-left: var(--sidebar-width);
    padding: 15px 20px !important;
    transition: all 0.3s;
    width: calc(100% - var(--sidebar-width));
    min-height: calc(100vh - var(--top-nav-height));
}

.main-content.expanded {
    margin-left: var(--sidebar-collapsed);
    width: calc(100% - var(--sidebar-collapsed));
}

/* Card Styles */
.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    margin-bottom: 1rem;
    border-radius: 8px;
}

.card-header {
    background-color: white;
    border-bottom: 1px solid rgba(0, 0, 0, 0.125);
    font-weight: 600;
    padding: 0.75rem 1rem;
}

/* Button Styles */
.btn {
    border-radius: 6px;
    font-weight: 500;
    padding: 0.375rem 0.75rem;
}

/* Accessibility */
.btn:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .breadcrumb-collapse {
        background: #2c3e50;
    }
    
    .breadcrumb-nav .nav-link {
        color: #f8f9fa;
    }
    
    .breadcrumb-nav .nav-link:hover {
        background-color: #34495e;
    }
    
    .breadcrumb-nav .nav-link.active {
        background-color: #1a5276;
    }
}