/**
 * Sidebar Orange Theme
 * Modern orange color scheme for admin sidebar
 */

/* Sidebar Base Styling */
.navbar-vertical {
    background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    border-right: 1px solid rgba(249, 115, 22, 0.1);
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
    display: flex !important;
    flex-direction: column !important;
    height: 100vh !important;
    position: fixed !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Container fluid should take full height */
.navbar-vertical .container-fluid {
    display: flex !important;
    flex-direction: column !important;
    min-height: 100% !important;
    padding-bottom: 0 !important;
}

/* Brand Logo Area */
.navbar-brand {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid rgba(249, 115, 22, 0.15);
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.05) 0%, transparent 100%);
    transition: all 0.3s ease;
}

.navbar-brand:hover {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, transparent 100%);
}

.navbar-brand img {
    filter: brightness(1.1);
    transition: all 0.3s ease;
}

.navbar-brand:hover img {
    filter: brightness(1.3);
    transform: scale(1.02);
}

/* Navigation Items */
.navbar-nav {
    padding: 0.5rem 0;
    flex: 1 1 auto !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Navbar collapse should grow */
.navbar-vertical .navbar-collapse {
    flex: 1 1 auto !important;
    display: flex !important;
    flex-direction: column !important;
    overflow-y: auto !important;
}

.nav-item {
    margin: 0.25rem 0.75rem;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.75rem 1rem !important;
    border-radius: 12px !important;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: linear-gradient(180deg, #f97316 0%, #ea580c 100%);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.nav-link:hover {
    color: #ffffff !important;
    background: rgba(249, 115, 22, 0.15) !important;
    transform: translateX(4px);
}

.nav-link:hover::before {
    transform: scaleY(1);
}

/* Active State */
.nav-item.active .nav-link,
.nav-link.active {
    color: #ffffff !important;
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.25) 0%, rgba(234, 88, 12, 0.25) 100%) !important;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
    font-weight: 600;
}

.nav-item.active .nav-link::before,
.nav-link.active::before {
    transform: scaleY(1);
}

/* Icons */
.nav-link-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.nav-link:hover .nav-link-icon {
    background: rgba(249, 115, 22, 0.2);
    transform: rotate(5deg) scale(1.1);
}

.nav-item.active .nav-link-icon,
.nav-link.active .nav-link-icon {
    background: rgba(249, 115, 22, 0.3);
    box-shadow: 0 0 12px rgba(249, 115, 22, 0.3);
}

.nav-link-icon i {
    color: #f97316;
    font-size: 1.25rem !important;
}

/* Dropdown Menu */
.nav-item.dropdown .dropdown-toggle::after {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.nav-item.dropdown .dropdown-toggle[aria-expanded="true"]::after {
    transform: rotate(180deg);
}

.dropdown-menu {
    background: rgba(0, 0, 0, 0.3) !important;
    border: 1px solid rgba(249, 115, 22, 0.1) !important;
    border-radius: 12px !important;
    margin: 0.5rem 0 !important;
    padding: 0.5rem !important;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    position: static !important;
    transform: none !important;
    width: 100% !important;
    max-height: none !important;
    overflow: visible !important;
}

.dropdown-item {
    color: rgba(255, 255, 255, 0.7) !important;
    padding: 0.65rem 1rem !important;
    border-radius: 8px !important;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.15rem 0;
}

.dropdown-item:hover {
    color: #ffffff !important;
    background: rgba(249, 115, 22, 0.2) !important;
    transform: translateX(6px);
}

.dropdown-item.active {
    color: #ffffff !important;
    background: rgba(249, 115, 22, 0.3) !important;
    font-weight: 600;
}

.dropdown-item i {
    color: #f97316;
    font-size: 0.75rem !important;
}

.dropdown-item.active i {
    color: #fb923c;
}

/* Version Footer */
.navbar-vertical .d-flex.fw-medium {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.85rem;
    padding: 1rem;
    border-top: 1px solid rgba(249, 115, 22, 0.1);
    background: rgba(249, 115, 22, 0.05);
    margin-top: auto !important;
    flex-shrink: 0 !important;
    transition: all 0.3s ease;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

.navbar-vertical .d-flex.fw-medium:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(249, 115, 22, 0.1);
}

/* Scrollbar Styling */
.navbar-vertical::-webkit-scrollbar {
    width: 6px;
}

.navbar-vertical::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.navbar-vertical::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.3);
    border-radius: 3px;
}

.navbar-vertical::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.5);
}

/* Mobile Toggle Button */
.navbar-toggler {
    border-color: rgba(249, 115, 22, 0.3) !important;
    color: #f97316 !important;
}

.navbar-toggler:hover {
    background: rgba(249, 115, 22, 0.1);
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(249, 115, 22, 1)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.nav-item {
    animation: slideIn 0.3s ease forwards;
}

.nav-item:nth-child(1) { animation-delay: 0.05s; }
.nav-item:nth-child(2) { animation-delay: 0.1s; }
.nav-item:nth-child(3) { animation-delay: 0.15s; }
.nav-item:nth-child(4) { animation-delay: 0.2s; }
.nav-item:nth-child(5) { animation-delay: 0.25s; }
.nav-item:nth-child(6) { animation-delay: 0.3s; }
.nav-item:nth-child(7) { animation-delay: 0.35s; }
.nav-item:nth-child(8) { animation-delay: 0.4s; }
.nav-item:nth-child(9) { animation-delay: 0.45s; }
.nav-item:nth-child(10) { animation-delay: 0.5s; }

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .navbar-vertical {
        background: linear-gradient(180deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    }
    
    .nav-item {
        margin: 0.25rem 0.5rem;
    }
    
    .dropdown-menu {
        position: static !important;
        transform: none !important;
        width: 100%;
    }
}

/* Hover Glow Effect */
.nav-link:hover,
.dropdown-item:hover {
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.1);
}

.nav-item.active .nav-link,
.nav-link.active {
    box-shadow: 0 4px 20px rgba(249, 115, 22, 0.25);
}


/* Fix for dropdown expansion not pushing content */
.navbar-vertical .navbar-nav {
    min-height: 0 !important;
    padding-bottom: 2rem !important;
}

/* Ensure dropdown items don't overlap footer */
.nav-item.dropdown {
    position: relative !important;
    z-index: 1 !important;
}

.nav-item.dropdown .dropdown-menu.show {
    display: block !important;
    position: static !important;
    margin-bottom: 1rem !important;
}

/* Prevent footer from being hidden */
.navbar-vertical > .container-fluid > .d-flex.fw-medium {
    position: sticky !important;
    bottom: 0 !important;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 26, 26, 0.95) 20%, #1a1a1a 100%) !important;
    padding-top: 1.5rem !important;
    margin-top: 0 !important;
    z-index: 100 !important;
}

/* Add padding to last nav item to prevent overlap */
.navbar-nav .nav-item:last-child {
    margin-bottom: 1rem !important;
}

/* Ensure proper spacing when dropdown is expanded */
.navbar-nav .nav-item.dropdown.show {
    margin-bottom: 0.5rem !important;
}

/* Fix scrolling behavior */
.navbar-vertical .navbar-collapse {
    max-height: calc(100vh - 200px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding-bottom: 1rem !important;
}

/* Custom scrollbar for navbar */
.navbar-vertical .navbar-collapse::-webkit-scrollbar {
    width: 6px;
}

.navbar-vertical .navbar-collapse::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.navbar-vertical .navbar-collapse::-webkit-scrollbar-thumb {
    background: rgba(249, 115, 22, 0.3);
    border-radius: 3px;
}

.navbar-vertical .navbar-collapse::-webkit-scrollbar-thumb:hover {
    background: rgba(249, 115, 22, 0.5);
}

/* Ensure dropdown animation doesn't cause layout shift */
.dropdown-menu {
    animation: dropdownSlideDown 0.3s ease-in-out !important;
}

@keyframes dropdownSlideDown {
    from {
        opacity: 0;
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
}

/* Fix for mobile view */
@media (max-width: 991.98px) {
    .navbar-vertical {
        height: auto !important;
        position: relative !important;
    }
    
    .navbar-vertical .navbar-collapse {
        max-height: none !important;
    }
    
    .navbar-vertical > .container-fluid > .d-flex.fw-medium {
        position: relative !important;
    }
}
