/* =============================================
   SIDEBAR LAYOUT - ROOMIFY STYLE (RESPONSIVE)
   ============================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #F9FAFB;
}

/* ✅ SIDEBAR LAYOUT */
.sidebar-layout {
    display: flex;
    min-height: 100vh;
}

/* ✅ SIDEBAR */
.sidebar {
    width: 240px;
    background: linear-gradient(180deg, #0B0F0E 0%, #135846 100%);
    color: white;
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    z-index: 1000;
    overflow-x: hidden;
    overflow-y: auto;
}

    .sidebar.collapsed {
        width: 70px;
    }

        .sidebar.collapsed .logo-text,
        .sidebar.collapsed .menu-text,
        .sidebar.collapsed .submenu-text,
        .sidebar.collapsed .submenu-toggle {
            opacity: 0;
            width: 0;
            overflow: hidden;
        }

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

/* ✅ LOGO SECTION */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

i.fas.fa-chevron-left {
    display: none !important;
}


.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #E23428 0%, #B91C1C 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

/* ✅ SIDEBAR MENU */
.sidebar-menu {
    flex: 1;
    padding: 20px 0;
}

.menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.menu-item {
    margin-bottom: 4px;
}

.menu-link {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

    .menu-link:hover {
        background: rgba(255, 255, 255, 0.06);
        color: white;
    }

    .menu-link.active {
        background: linear-gradient(90deg, rgba(226, 52, 40, 0.25) 0%, transparent 100%);
        color: white;
        border-left: 3px solid #E23428;
    }

.menu-icon {
    width: 20px;
    font-size: 18px;
    flex-shrink: 0;
    margin-right: 12px;
    color: rgba(255, 255, 255, 0.6);
}

.menu-text {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    white-space: nowrap;
    color: #fff;
}

.submenu-toggle {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.menu-item.open .submenu-toggle {
    transform: rotate(45deg);
    color: #E23428;
}

/* ✅ SUBMENU */
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: rgba(0, 0, 0, 0.25);
}

.menu-item.open .submenu {
    max-height: 500px;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 12px 20px 12px 52px;
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    font-size: 13px;
    transition: all 0.2s ease;
    color: #fff!important;
}

    .submenu-link:hover {
        background: rgba(226, 52, 40, 0.15);
        color: white;
        padding-left: 56px;
    }

.submenu-icon {
    width: 16px;
    font-size: 14px;
    margin-right: 10px;
}

/* ✅ SIDEBAR ILLUSTRATION */
.sidebar-illustration {
    padding: 20px;
    opacity: 0.25;
}

    .sidebar-illustration svg {
        width: 100%;
        height: auto;
    }

/* ✅ MAIN CONTENT */
.main-content {
    flex: 1;
    margin-left: 240px;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: 70px;
}

/* ✅ TOPBAR */
.topbar {
    background: white;
    border-bottom: 1px solid #E5E7EB;
    padding: 16px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.sidebar-toggle {
    background: transparent;
    border: none;
    font-size: 20px;
    color: #6B7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .sidebar-toggle:hover {
        background: #F3F4F6;
        color: #1F2937;
    }

.page-title {
    font-size: 20px;
    font-weight: 600;
    color: #1F2937;
    margin: 0;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* ✅ SEARCH BOX */
.search-box {
    position: relative;
    width: 300px;
}

.search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    font-size: 14px;
}

.search-input {
    width: 100%;
    padding: 10px 15px 10px 45px;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

    .search-input:focus {
        border-color: #E23428;
        box-shadow: 0 0 0 3px rgba(226, 52, 40, 0.15);
    }

/* ✅ NOTIFICATION BELL */
.notification-bell {
    position: relative;
}

.topbar-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #6B7280;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
}

    .topbar-link:hover {
        background: #F3F4F6;
        color: #1F2937;
    }

    .topbar-link i {
        font-size: 18px;
    }

.notification-badge {
    position: absolute;
    top: 5px;
    right: 8px;
    background: #E23428;
    color: white;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: 600;
}

/* ✅ USER PROFILE */
.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #E5E7EB;
}

.user-name {
    font-size: 14px;
    font-weight: 500;
    color: #1F2937;
}

/* ✅ PAGE CONTENT */
.page-content {
    flex: 1;
    padding: 0;
}

.page-footer {
    padding: 20px 30px;
    background: white;
    border-top: 1px solid #E5E7EB;
    color: #6B7280;
    font-size: 14px;
}

/* ✅ NOTIFICATION DROPDOWN */
.notification-dropdown {
    width: 350px;
    max-height: 400px;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 12px;
}

.notification-item {
    border-bottom: 1px solid #F3F4F6;
    padding: 12px 16px;
    transition: background-color 0.2s;
    cursor: pointer;
}

    .notification-item:hover {
        background-color: #F9FAFB;
    }

    .notification-item.unread {
        background-color: #FFF1F0;
        border-left: 3px solid #E23428;
    }

/* ✅ DROPDOWN STYLING */
#logoutForm {
    margin: 0;
    padding: 0;
}

    #logoutForm button {
        width: 100%;
        text-align: left;
        border: none;
        background: none;
        padding: 0.5rem 1rem;
        cursor: pointer;
    }

        #logoutForm button:hover {
            background-color: #F9FAFB;
        }

/* ✅ SCROLLBAR STYLING */
.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.25);
    border-radius: 10px;
}

    .sidebar::-webkit-scrollbar-thumb:hover {
        background: rgba(255, 255, 255, 0.35);
    }

/* =============================================
   ✅ RESPONSIVE DESIGN - ENHANCED
   ============================================= */

/* 📱 TABLETS AND SMALL DESKTOPS (max-width: 1024px) */
@media (max-width: 1024px) {
    .search-box {
        width: 200px;
    }

    .topbar {
        padding: 14px 20px;
    }

    .page-title {
        font-size: 18px;
    }

    .page-footer {
        padding: 16px 20px;
    }
}

/* 📱 TABLETS (max-width: 768px) */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .sidebar {
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.3);
    }

        /* Show sidebar when 'open' class is added */
        .sidebar.open {
            transform: translateX(0);
        }

    /* Remove left margin from main content */
    .main-content {
        margin-left: 0 !important;
    }

    /* Topbar adjustments */
    .topbar {
        padding: 12px 16px;
    }

    .topbar-left {
        gap: 12px;
    }

    .topbar-right {
        gap: 12px;
    }

    /* Hide search box on mobile */
    .search-box {
        display: none;
    }

    /* Hide user name on mobile */
    .user-name {
        display: none;
    }

    /* Adjust page title */
    .page-title {
        font-size: 16px;
        font-weight: 600;
    }

    /* Notification dropdown smaller on mobile */
    .notification-dropdown {
        width: 280px;
        max-height: 350px;
    }

    /* Footer adjustments */
    .page-footer {
        padding: 14px 16px;
        font-size: 12px;
        text-align: center;
    }

    /* User avatar smaller */
    .user-avatar {
        width: 32px;
        height: 32px;
    }

    /* Overlay when sidebar is open */
    .sidebar.open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: -1;
    }
}

/* 📱 SMALL MOBILE DEVICES (max-width: 480px) */
@media (max-width: 480px) {
    .sidebar {
        width: 280px;
    }

    .topbar {
        padding: 10px 12px;
    }

    .topbar-left {
        gap: 8px;
    }

    .topbar-right {
        gap: 8px;
    }

    .page-title {
        font-size: 14px;
    }

    .sidebar-toggle {
        padding: 6px;
        font-size: 18px;
    }

    .topbar-link {
        padding: 6px 8px;
    }

        .topbar-link i {
            font-size: 16px;
        }

    .notification-badge {
        top: 3px;
        right: 5px;
        padding: 1px 4px;
        font-size: 9px;
    }

    .user-avatar {
        width: 28px;
        height: 28px;
    }

    .page-footer {
        padding: 12px;
        font-size: 11px;
    }

    /* Notification dropdown even smaller */
    .notification-dropdown {
        width: calc(100vw - 32px);
        max-width: 280px;
    }

    .notification-item {
        padding: 10px 12px;
        font-size: 13px;
    }

    /* Sidebar logo adjustments */
    .sidebar-logo {
        padding: 20px 16px;
    }

    .logo-text {
        font-size: 18px;
    }

    /* Menu adjustments */
    .menu-link {
        padding: 12px 16px;
    }

    .submenu-link {
        padding: 10px 16px 10px 48px;
    }

        .submenu-link:hover {
            padding-left: 52px;
        }
}

/* 📱 EXTRA SMALL DEVICES (max-width: 360px) */
@media (max-width: 360px) {
    .sidebar {
        width: 260px;
    }

    .page-title {
        font-size: 13px;
        max-width: 120px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .topbar {
        padding: 8px 10px;
    }

    .logo-text {
        font-size: 16px;
    }

    .notification-dropdown {
        width: calc(100vw - 24px);
    }
}

/* ✅ LANDSCAPE MODE ON MOBILE */
@media (max-height: 500px) and (orientation: landscape) {
    .sidebar {
        overflow-y: auto;
    }

    .sidebar-illustration {
        display: none;
    }

    .topbar {
        padding: 8px 16px;
    }
}

/* ✅ PRINT STYLES */
@media print {
    .sidebar,
    .topbar,
    .page-footer {
        display: none;
    }

    .main-content {
        margin-left: 0 !important;
    }

    .page-content {
        padding: 0 !important;
    }
}

/* ✅ LARGE DESKTOP (min-width: 1440px) */
@media (min-width: 1440px) {
    .search-box {
        width: 400px;
    }

    .topbar {
        padding: 18px 40px;
    }

    .page-footer {
        padding: 24px 40px;
    }
}


/* ✅ ACCESSIBILITY - HIGH CONTRAST MODE */
@media (prefers-contrast: high) {
    .sidebar {
        border-right: 2px solid white;
    }

    .menu-link.active {
        border-left: 4px solid #E23428;
    }
}

/* ✅ REDUCED MOTION PREFERENCE */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
