/* Responsive Navigation and Sidebar */

/* Base sidebar styles */
.layout-menu {
    transition: all 0.3s ease-in-out;
    z-index: 1050;
}

/* Mobile navigation improvements */
@media (max-width: 1199.98px) {
    .layout-menu {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 260px;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .layout-menu.show {
        transform: translateX(0);
    }
    
    .layout-page {
        margin-left: 0 !important;
    }
    
    .layout-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .layout-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}

/* Mobile menu toggle button */
.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1060;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    cursor: pointer;
}

@media (max-width: 1199.98px) {
    .mobile-menu-toggle {
        display: block;
    }
}

/* App brand responsive */
.app-brand {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

@media (max-width: 575.98px) {
    .app-brand {
        padding: 0.75rem;
    }
    
    .app-brand-text {
        font-size: 1rem !important;
    }
    
    .app-brand-logo img {
        height: 16px !important;
    }
}

/* Menu items responsive */
.menu-inner {
    padding: 0.5rem 0;
}

.menu-item {
    margin-bottom: 0.25rem;
}

.menu-link {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 0.375rem;
    margin: 0 0.5rem;
}

.menu-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.menu-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.menu-link i {
    margin-right: 0.75rem;
    font-size: 1.125rem;
    width: 1.5rem;
    text-align: center;
}

@media (max-width: 575.98px) {
    .menu-link {
        padding: 0.625rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .menu-link i {
        margin-right: 0.5rem;
        font-size: 1rem;
        width: 1.25rem;
    }
}

/* Submenu styles */
.menu-sub {
    padding-left: 0;
    margin: 0;
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

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

.menu-sub .menu-item {
    margin-bottom: 0;
}

.menu-sub .menu-link {
    padding: 0.5rem 1rem 0.5rem 3rem;
    font-size: 0.875rem;
    margin: 0 0.5rem;
}

@media (max-width: 575.98px) {
    .menu-sub .menu-link {
        padding: 0.5rem 0.75rem 0.5rem 2.5rem;
        font-size: 0.8125rem;
    }
}

/* Menu toggle arrow */
.menu-toggle::after {
    content: '\f107';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    margin-left: auto;
    transition: transform 0.3s ease;
}

.menu-item.open .menu-toggle::after {
    transform: rotate(180deg);
}

/* Menu header */
.menu-header {
    padding: 1rem 1rem 0.5rem;
    margin-bottom: 0.5rem;
}

.menu-header-text {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

@media (max-width: 575.98px) {
    .menu-header {
        padding: 0.75rem 0.75rem 0.25rem;
    }
    
    .menu-header-text {
        font-size: 0.6875rem;
    }
}

/* Navbar responsive */
.navbar {
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

@media (max-width: 575.98px) {
    .navbar {
        padding: 0.5rem 0.75rem;
    }
    
    .navbar-brand {
        font-size: 1rem;
    }
}

/* Navbar nav responsive */
.navbar-nav {
    flex-direction: row;
    align-items: center;
}

@media (max-width: 767.98px) {
    .navbar-nav {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    
    .navbar-nav .nav-item {
        width: 100%;
        margin-bottom: 0.25rem;
    }
    
    .navbar-nav .nav-link {
        padding: 0.5rem 0;
        width: 100%;
    }
}

/* Dropdown menu responsive */
.dropdown-menu {
    min-width: 200px;
    border: none;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
}

@media (max-width: 575.98px) {
    .dropdown-menu {
        position: static !important;
        float: none;
        width: 100%;
        margin-top: 0;
        box-shadow: none;
        border: 1px solid #dee2e6;
        border-radius: 0.375rem;
    }
}

/* User dropdown responsive */
.user-dropdown {
    position: relative;
}

.user-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    cursor: pointer;
}

@media (max-width: 575.98px) {
    .user-avatar {
        width: 1.75rem;
        height: 1.75rem;
    }
}

/* Notification dropdown */
.notification-dropdown {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

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

.notification-item:last-child {
    border-bottom: none;
}

@media (max-width: 575.98px) {
    .notification-item {
        padding: 0.5rem 0.75rem;
    }
}

/* Search bar responsive */
.navbar-search {
    position: relative;
    max-width: 300px;
    width: 100%;
}

.navbar-search .form-control {
    padding-right: 2.5rem;
    border: 1px solid #dee2e6;
    border-radius: 1.5rem;
}

.navbar-search .search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #6c757d;
}

@media (max-width: 767.98px) {
    .navbar-search {
        max-width: 100%;
        margin: 0.5rem 0;
    }
}

@media (max-width: 575.98px) {
    .navbar-search .form-control {
        font-size: 0.875rem;
        padding: 0.5rem 2rem 0.5rem 1rem;
    }
}

/* Breadcrumb responsive */
.breadcrumb-container {
    background: transparent;
    padding: 0.5rem 0;
}

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

.breadcrumb-item {
    color: #6c757d;
}

.breadcrumb-item.active {
    color: #495057;
    font-weight: 500;
}

@media (max-width: 575.98px) {
    .breadcrumb {
        font-size: 0.8125rem;
    }
    
    .breadcrumb-item {
        max-width: 100px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

/* Footer responsive */
.footer {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 1rem;
    margin-top: auto;
}

@media (max-width: 575.98px) {
    .footer {
        padding: 0.75rem;
        text-align: center;
    }
    
    .footer .row {
        flex-direction: column;
    }
    
    .footer .col {
        margin-bottom: 0.5rem;
    }
}

/* Content wrapper responsive */
.content-wrapper {
    min-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
}

@media (max-width: 1199.98px) {
    .content-wrapper {
        margin-left: 0;
    }
}

/* Page title responsive */
.page-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #495057;
    margin-bottom: 1rem;
}

@media (max-width: 767.98px) {
    .page-title {
        font-size: 1.5rem;
        margin-bottom: 0.75rem;
    }
}

@media (max-width: 575.98px) {
    .page-title {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }
}

/* Touch-friendly navigation */
@media (hover: none) and (pointer: coarse) {
    .menu-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .navbar-nav .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
    }
    
    .dropdown-item {
        min-height: 44px;
        display: flex;
        align-items: center;
        padding: 0.75rem 1rem;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .navbar {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
    
    .dropdown-menu {
        background: #2d3748;
        border-color: #4a5568;
    }
    
    .dropdown-item {
        color: #e2e8f0;
    }
    
    .dropdown-item:hover {
        background: #4a5568;
        color: #fff;
    }
    
    .breadcrumb-item {
        color: #a0aec0;
    }
    
    .breadcrumb-item.active {
        color: #e2e8f0;
    }
    
    .footer {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }
}
