/* Sidebar Navigation Styles */
:root {
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 65px;
    --sidebar-bg: var(--bs-dark);
    --sidebar-hover: rgba(0, 162, 232, 0.15);
    --sidebar-active: rgba(0, 162, 232, 0.25);
    --sidebar-text: rgba(255, 255, 255, 0.95);
    --sidebar-text-hover: #ffffff;
}

/* Force white text in dark theme - specific targeting */
[data-bs-theme="dark"] .sidebar-brand,
[data-bs-theme="dark"] .sidebar-brand span,
[data-bs-theme="dark"] .sidebar-brand:hover,
[data-bs-theme="dark"] .sidebar-brand:focus,
[data-bs-theme="dark"] .mobile-navbar-brand,
[data-bs-theme="dark"] .mobile-navbar-brand span,
[data-bs-theme="dark"] .mobile-navbar-brand:hover,
[data-bs-theme="dark"] .mobile-navbar-brand:focus,
[data-bs-theme="dark"] .sidebar-nav .nav-link,
[data-bs-theme="dark"] .sidebar-nav .nav-link span,
[data-bs-theme="dark"] .sidebar-user-name,
[data-bs-theme="dark"] .language-selector a,
[data-bs-theme="dark"] .sidebar-toggle,
[data-bs-theme="dark"] .sidebar-toggle i,
[data-bs-theme="dark"] .mobile-toggle,
[data-bs-theme="dark"] .mobile-toggle i,
[data-bs-theme="dark"] button,
[data-bs-theme="dark"] button i,
[data-bs-theme="dark"] .btn,
[data-bs-theme="dark"] .btn i {
    color: #ffffff !important;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--sidebar-bg);
    transition: all 0.3s ease;
    z-index: 1030;
    overflow-y: auto;
    box-shadow: 1px 0 15px rgba(0, 0, 0, 0.1);
}

.sidebar-header {
    padding: 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    top: 0;
    background-color: var(--sidebar-bg);
    z-index: 10;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
}

.sidebar-brand span,
.sidebar-brand:hover,
.sidebar-brand:focus,
.sidebar-brand:visited {
    color: #ffffff !important;
}

.sidebar-brand img {
    height: 36px;
    width: auto;
    margin-right: 10px;
}

.sidebar-brand span {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff !important;
    white-space: nowrap;
}

.sidebar-nav {
    padding: 1rem 0;
}

.sidebar-nav .nav-item {
    margin-bottom: 0.25rem;
}

.sidebar-nav .nav-link {
    color: var(--sidebar-text) !important;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: 0;
    font-weight: 500;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-nav .nav-link:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-hover) !important;
}

.sidebar-nav .nav-link.active {
    background-color: var(--sidebar-active);
    color: var(--sidebar-text-hover) !important;
    border-left: 3px solid var(--pwt-blue);
}

.sidebar-nav .nav-link i {
    min-width: 24px;
    text-align: center;
    margin-right: 10px;
    font-size: 1rem;
    flex-shrink: 0;
}

.sidebar-nav .nav-link-admin {
    background-color: rgba(255, 222, 0, 0.1);
    color: rgba(255, 222, 0, 0.9) !important;
    padding: 0.75rem 0.75rem;
    font-size: 0.95rem;
}

.sidebar-nav .nav-link-admin:hover {
    background-color: rgba(255, 222, 0, 0.2);
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    position: sticky;
    bottom: 0;
    background-color: var(--sidebar-bg);
}

.sidebar-toggle {
    background: rgba(0, 162, 232, 0.1);
    border: none;
    color: #ffffff !important;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    margin-right: -8px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 20;
}

.sidebar-toggle:hover {
    color: #ffffff !important;
    background: rgba(0, 162, 232, 0.2);
}

.sidebar-toggle i {
    color: #ffffff !important;
}

/* Main content adjustments */
.main-content {
    margin-left: var(--sidebar-width);
    transition: margin-left 0.3s ease;
    min-height: 100vh;
    padding: 1rem;
    position: relative;
}

/* Collapsed sidebar styles */
.sidebar-collapsed .sidebar {
    width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .sidebar-brand span,
.sidebar-collapsed .sidebar-nav .nav-link span,
.sidebar-collapsed .sidebar-footer span,
.sidebar-collapsed .language-selector span {
    display: none;
}

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

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

.sidebar-collapsed .sidebar-nav .nav-link i {
    margin-right: 0;
}

/* Make the toggle button more visible in collapsed state */
.sidebar-collapsed .sidebar-toggle {
    position: fixed;
    left: 55px; /* Moved further right to be fully visible */
    top: 20px;
    background-color: var(--bs-dark);
    border: 1px solid rgba(0, 162, 232, 0.6);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
    z-index: 1050;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* User profile dropdown in sidebar footer */
.sidebar-user {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--sidebar-text);
    cursor: pointer;
}

.sidebar-user-info {
    display: flex;
    align-items: center;
}

.sidebar-user-info img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 10px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.sidebar-user-name {
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-user-menu {
    position: absolute;
    bottom: 70px;
    left: 20px;
    width: calc(100% - 40px);
    background-color: var(--bs-dark);
    border-radius: 6px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
    display: none;
}

.sidebar-user-menu.show {
    display: block;
}

.sidebar-user-menu a {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.2s;
}

.sidebar-user-menu a:hover {
    background-color: var(--sidebar-hover);
    color: var(--sidebar-text-hover);
}

.sidebar-user-menu a i {
    width: 20px;
    margin-right: 8px;
    text-align: center;
}

.sidebar-user-menu .dropdown-divider {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin: 0.25rem 0;
}

/* Language selector in sidebar */
.language-selector {
    margin: 0.5rem 1rem 1rem;
    display: flex;
    justify-content: space-around;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.language-selector a {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    color: rgba(255, 255, 255, 0.9) !important;
    text-decoration: none;
    font-size: 0.9rem;
    background-color: transparent;
    transition: all 0.2s;
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-weight: 500;
}

.language-selector a:hover {
    background-color: rgba(0, 162, 232, 0.15);
    color: rgba(255, 255, 255, 1) !important;
}

.language-selector a.active {
    background-color: rgba(0, 162, 232, 0.25);
    color: #ffffff !important;
    font-weight: 600;
}

/* Mobile adjustments */
@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.show {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-collapsed .main-content {
        margin-left: 0;
    }
    
    .mobile-navbar {
        display: flex !important;
    }
}

/* Mobile navbar for sidebar toggle */
.mobile-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1029;
    background-color: var(--sidebar-bg);
    padding: 0.75rem 1rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.mobile-navbar-brand {
    display: flex;
    align-items: center;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
}

.mobile-navbar-brand img {
    height: 30px;
    margin-right: 10px;
}

.mobile-navbar-brand span {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff !important;
    white-space: nowrap;
}

.mobile-toggle {
    background: transparent;
    border: none;
    color: #ffffff !important;
    font-size: 1.25rem;
    cursor: pointer;
}

.mobile-toggle:hover {
    color: #ffffff !important;
}

.mobile-toggle i {
    color: #ffffff !important;
}

/* Page content padding on mobile */
@media (max-width: 991.98px) {
    body {
        padding-top: 60px;
    }
}