/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    --primary: #ff6b35;
    --primary-dark: #d94e1f;
    --primary-light: #ff8c5a;
    --secondary: #78716c;
    --accent: #ffa500;
    --light: #fffaf5;
    --dark: #1a1a2e;
    --success: #10b981;
    --warning: #ff9800;
    --danger: #ef4444;
    --sidebar-bg: #ffffff;
    --sidebar-hover: #fff4ed;
    --sidebar-active: #ffe8d9;
    --text-dark: #2d2d2d;
    --text-muted: #78716c;
    --border-light: #ffd7ba;
}

/* ========================================
   GLOBAL RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--dark);
    display: flex;
    min-height: 100vh;
    overflow: hidden;
}





/* ========================================
   CUSTOM SCROLLBAR STYLES
   ======================================== */
/* Webkit Browsers (Chrome, Safari, Edge) */
/* width */
::-webkit-scrollbar {
    width: 10px;
}

/* Track */
::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* Handle */
::-webkit-scrollbar-thumb {
    background-color: var(--primary);
}

/* Handle on hover */
::-webkit-scrollbar-thumb:hover {
    background-color: var(--primary-dark);
}

/* Firefox */
/* * { */
/* scrollbar-width: thin; */
/* scrollbar-color: var(--primary) var(--light); */
/* } */




/* ========================================
   SIDEBAR - BASE STYLES
   ======================================== */
.sidebar {
    width: 250px;
    background-color: var(--sidebar-bg);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: 2px 0 15px rgba(0, 0, 0, 0.08);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    z-index: 1000;
}

.sidebar.collapsed {
    width: 50px;
}




/* ========================================
   SIDEBAR - HEADER SECTION
   ======================================== */
.sidebar-header {
    flex-shrink: 0;
    border-bottom: 1px solid var(--border-light);
}

.logo-container {
    padding: 10px 15px;
    display: flex;
    align-items: center;
    /* justify-content: space-between; */
    justify-content: center;
    /* background: linear-gradient(135deg, #ff8c00 0%, #ffb088 100%); */
    background: linear-gradient(135deg, #ffb088 0%, #f7753e 100%);
}

.hospital-info {
    flex: 1;
    overflow: hidden;
}

.name-text {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.db-text {
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.5px;
}

.sidebar.collapsed .hospital-info {
    display: none;
}

/* ========================================
   SIDEBAR - TOGGLE BUTTON
   ======================================== */
.toggle-btn {
    background: rgba(255, 255, 255, 0.8);
    border: none;
    /* color: #ffffff; */
    font-size: 21px;
    cursor: pointer;
    padding: 5px;
    border-radius: 5px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.toggle-btn:hover {
    /* background: rgba(255, 255, 255, 0.3); */
    /* color: #ffffff; */
    transform: scale(1.1);
}

.sidebar.collapsed .toggle-btn i {
    transform: rotate(180deg);
    /* color: #ffffff; */
    width: 20px;
}



/* ========================================
   SIDEBAR - NAVIGATION SECTION
   ======================================== */
.nav-section {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-top: 10px;
}

/* Custom Scrollbar for Navigation */
.nav-section::-webkit-scrollbar {
    width: 6px;
}

.nav-section::-webkit-scrollbar-track {
    background: transparent;
}

.nav-section::-webkit-scrollbar-thumb {
    background: #ff8c00;
}

.nav-section::-webkit-scrollbar-thumb:hover {
    background: black;
}

/* Navigation Links */
.nav-links {
    list-style: none;
    padding: 0;
}

.nav-links li {
    display: flex;
    align-items: center;
    white-space: nowrap;
    position: relative;
}

.nav-links .nav-item {
    padding: 7px 17px;
    margin: 2px 0;
    display: flex;
    align-items: center;
    width: 100%;
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
}

.nav-links .nav-item:hover {
    background-color: var(--sidebar-hover);
    padding-left: 25px;
    color: var(--primary);
}

.nav-links .nav-item.active {
    background-color: var(--sidebar-active);
    border-left: 4px solid var(--primary);
    color: var(--primary);
    font-weight: 600;
    padding: 10px 17px;
}

.nav-links i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    /* pointer-events: none; */
}

.hr_1 {
    border: 1px solid black;
    border: 1px solid rgb(255, 140, 0);
    margin: 7px auto;
    width: 70%;
}


/* Collapsed Sidebar - Navigation */
.sidebar.collapsed .nav-links .nav-item {
    padding: 7px 0;
    justify-content: center;
    width: 100%;
    font-size: 0;
}

.sidebar.collapsed .nav-links .nav-item:hover {
    padding-left: 0;
}

.sidebar.collapsed .nav-links .nav-item.active {
    padding-left: 0;
}

.sidebar.collapsed .nav-links li {
    justify-content: center;
}

.sidebar.collapsed .nav-links i {
    margin-right: 0;
    font-size: 19px;
}

.sidebar.collapsed .nav-links .hr_1 {
    /* border: 1px solid rgb(255, 140, 0); */
    border: 1px solid black;
    width: 80%;
}

/* ========================================
   SIDEBAR - FOOTER SECTION
   ======================================== */
.sidebar-footer {
    flex-shrink: 0;
}

.logout-btn {
    padding: 14px 20px;
    display: flex;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s;
    white-space: nowrap;
    /* background: linear-gradient(135deg, #fec5c5 0%, #ff2f2f 100%); */
    background: linear-gradient(135deg, #ffb088 0%, #ff6b35 100%);
    border: none;
    /* color: var(--danger); */
    width: 100%;
    text-align: left;
    font-size: 16px;
    font-weight: bold;
}

.logout-btn:hover {
    /* background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); */
    background: linear-gradient(135deg, #ff8c5a 0%, #d94e1f 100%);
    color: white;
    padding-left: 25px;
}

.logout-btn i {
    margin-right: 12px;
    font-size: 18px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

.logout-btn span {
    opacity: 1;
    transition: opacity 0.3s;
}

/* Collapsed Sidebar - Logout Button */
.sidebar.collapsed .logout-btn {
    justify-content: center;
    padding: 14px 10px;
}

.sidebar.collapsed .logout-btn span {
    opacity: 0;
    display: none;
}

.sidebar.collapsed .logout-btn i {
    margin-right: 0;
}

/* Developer Text in Sidebar Footer */
.sidebar-footer .dev-text {
    font-weight: bold;
    text-align: center;
    padding: 10px 15px;
    font-size: 14px;
    background-color: var(--sidebar-bg);
}

.sidebar-footer .dev-text a {
    color: #ff8c00;
    text-decoration: none;
}

.sidebar-footer .dev-text .dev-text-inside {
    color: #008080;
}

/* Hide dev-text when sidebar is collapsed (icon-only view) */
.sidebar.collapsed .sidebar-footer .dev-text {
    display: none;
}

/* ========================================
   MAIN CONTENT AREA
   ======================================== */
.main-content {
    flex: 1;
    margin-left: 260px;
    transition: margin-left 0.3s ease;
    overflow-y: auto;
    height: 100vh;
    padding: 20px;
}

.sidebar.collapsed+.main-content {
    /* When sidebar is collapsed (50px + 20px margin = 70px) */
    margin-left: 70px;
}








/* ========================================
   MOBILE OVERLAY
   ======================================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.sidebar-overlay.active {
    display: block;
}

/* ========================================
   RESPONSIVE DESIGN - MOBILE
   ======================================== */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .sidebar.collapsed {
        width: 260px;
    }

    .main-content {
        margin-left: 0;
    }

    .sidebar.collapsed+.main-content {
        margin-left: 0;
    }

    /* Hide desktop toggle button on mobile */
    .toggle-btn {
        display: none;
    }

    /* Override collapsed state on mobile - always show full sidebar */
    .sidebar.collapsed .hospital-info {
        display: block !important;
    }

    .sidebar.collapsed .nav-links .nav-item {
        opacity: 1 !important;
        width: 100% !important;
        padding: 14px 20px !important;
        overflow: visible !important;
        font-size: 16px !important;
        justify-content: flex-start !important;
    }

    .sidebar.collapsed .nav-links li {
        justify-content: flex-start !important;
    }

    .sidebar.collapsed .nav-links i {
        margin-right: 12px !important;
    }

    .sidebar.collapsed .logout-btn {
        justify-content: flex-start !important;
        padding: 14px 20px !important;
    }

    .sidebar.collapsed .logout-btn span {
        opacity: 1 !important;
        display: inline !important;
    }

    .sidebar.collapsed .logout-btn i {
        margin-right: 12px;
    }

    /* Show dev-text on mobile when sidebar is active */
    .sidebar.collapsed .sidebar-footer .dev-text {
        display: block !important;
    }

    /* Mobile Menu Button */
    .mobile-menu-btn {
        display: block;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 998;
        background-color: var(--primary);
        color: white;
        border: none;
        padding: 12px 15px;
        border-radius: 8px;
        cursor: pointer;
        font-size: 19px;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    }

    .mobile-menu-btn:hover {
        background-color: var(--primary-dark);
    }
}



/* ========================================
   RESPONSIVE DESIGN - DESKTOP
   ======================================== */
@media (min-width: 768px) {
    .mobile-menu-btn {
        display: none;
    }
}





@media print {
    body {
        display: none;
    }
}

@media screen and (max-width: 380px) {
    body {
        display: none;
    }
}