/* ============================================
   PREMIUM MODERN UI REDESIGN
   PropertyLab Dashboard
   ============================================ */

/* ============================================
   1. SIDEBAR MINIMIZED/HOVER EXPANSION
   ============================================ */

#sidebar {
    width: 80px;
    padding: 1.5rem 0.5rem !important;
    transition: width 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-right: 1px solid #e8ecf1;
    position: relative;
    overflow: hidden;
}

#sidebar:hover {
    width: 280px;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
}

/* Logo styling */
#sidebar .btn {
    padding: 0.75rem 0.5rem;
    margin-bottom: 1.5rem;
    border: none;
    background: transparent;
}

#sidebar .btn img {
    transition: all 0.3s ease;
}

#sidebar:hover .desktop-logo {
    display: block;
}

#sidebar:hover .mobile-logo {
    display: none;
}

#sidebar .desktop-logo {
    display: none;
    max-width: 200px;
}

#sidebar .mobile-logo {
    max-width: 40px;
}

/* Business selector */
#selectBusinessId {
    opacity: 0;
    width: 20px;
    height: 40px;
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

#sidebar:hover #selectBusinessId {
    opacity: 1;
    width: 100%;
    height: auto;
    padding: 0.75rem !important;
    border: 1px solid #e0e6ed !important;
    background: #ffffff !important;
}

/* Navigation list */
#sidebar ul {
    transition: all 0.3s ease;
}

#sidebar li {
    margin-bottom: 0.75rem;
}

#sidebar .nav-link {
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    color: #5a6c7d;
    font-weight: 500;
    transition: all 0.25s ease;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
}

#sidebar:hover .nav-link {
    padding: 0.75rem 1rem;
}

#sidebar .nav-link:hover {
    background-color: #f0f4f9;
    color: #0d6efd;
    transform: translateX(4px);
}

#sidebar .nav-link i.icon {
    min-width: 24px;
    text-align: center;
    margin-right: 0;
    transition: all 0.25s ease;
}

#sidebar:hover .nav-link i.icon {
    margin-right: 0.75rem;
}

#sidebar .sidebar-text {
    opacity: 0;
    display: inline-block;
    transition: opacity 0.3s ease;
}

#sidebar:hover .sidebar-text {
    opacity: 1;
}

/* Settings section */
#sidebar .mt-auto {
    opacity: 0;
    transition: opacity 0.3s ease;
}

#sidebar:hover .mt-auto {
    opacity: 1;
}

/* ============================================
   2. PERFORMANCE SUBMENU STYLING
   ============================================ */

#performance-collapse {
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #f0f4f9 100%);
    border-radius: 8px;
    padding: 0.5rem 0;
    border-left: 3px solid #0d6efd;
}

#performance-collapse .nav-link {
    padding: 0.65rem 0.75rem;
    border-radius: 6px;
    color: #5a6c7d;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 0.25rem 0.5rem;
}

#performance-collapse .nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #0d6efd;
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.25s ease;
}

#performance-collapse .nav-link:hover {
    background: rgba(13, 110, 253, 0.08);
    color: #0d6efd;
    transform: translateX(4px);
}

#performance-collapse .nav-link:hover::before {
    opacity: 1;
}

#performance-collapse .nav-link.active {
    background: rgba(13, 110, 253, 0.12);
    color: #0d6efd;
    font-weight: 600;
}

#performance-collapse .nav-link.active::before {
    opacity: 1;
}

#performance-collapse .nav-link i.icon {
    width: 18px;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 0.95rem;
}

/* Toggle button styling */
.btn-toggle {
    padding: 0.75rem 0.5rem;
    border-radius: 8px;
    color: #5a6c7d;
    font-weight: 600;
    transition: all 0.25s ease;
    background: transparent;
    border: none;
}

#sidebar:hover .btn-toggle {
    padding: 0.75rem 1rem;
}

.btn-toggle:hover {
    background: #f0f4f9;
    color: #0d6efd;
}

.btn-toggle .toggle-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.8rem;
    margin-left: auto;
}

.btn-toggle:not(.collapsed) .toggle-icon {
    transform: rotate(180deg);
}

/* ============================================
   3. TOP-RIGHT USER MENU REDESIGN
   ============================================ */

/* Header styling */
.navbar-laravel {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-bottom: 1px solid #e8ecf1;
    padding: 0.75rem 2rem;
}

/* User menu container */
.user-menu-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

/* User avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
    transition: all 0.25s ease;
    cursor: pointer;
}

.user-avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
}

/* User info */
.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: all 0.25s ease;
}

.user-info:hover {
    background: rgba(13, 110, 253, 0.05);
}

.user-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.user-email {
    font-size: 0.8rem;
    color: #7f8c8d;
}

.user-dropdown-icon {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a6c7d;
    transition: transform 0.25s ease;
}

.user-info:hover .user-dropdown-icon {
    transform: rotate(180deg);
    color: #0d6efd;
}

/* Dropdown menu */
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.12);
    border: 1px solid #e8ecf1;
    min-width: 280px;
    margin-top: 0.75rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}

.user-dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown header */
.dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid #e8ecf1;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.dropdown-header-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 1.1rem;
}

.dropdown-header-info h6 {
    margin: 0;
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
}

.dropdown-header-info p {
    margin: 0.25rem 0 0 0;
    font-size: 0.8rem;
    color: #7f8c8d;
}

/* Dropdown items */
.dropdown-item {
    padding: 0.75rem 1rem;
    color: #5a6c7d;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.25s ease;
    font-weight: 500;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.dropdown-item:hover {
    background: #f8f9fa;
    color: #0d6efd;
    padding-left: 1.25rem;
}

.dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.95rem;
}

.dropdown-divider {
    margin: 0.5rem 0;
    border: none;
    border-top: 1px solid #e8ecf1;
}

.dropdown-item.logout {
    color: #dc3545;
}

.dropdown-item.logout:hover {
    background: rgba(220, 53, 69, 0.08);
    color: #dc3545;
}

/* ============================================
   4. SMOOTH ANIMATIONS & TRANSITIONS
   ============================================ */

/* Ripple effect on click */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.3);
    transform: scale(0);
    animation: ripple 0.6s ease-out;
    pointer-events: none;
}

/* Fade in animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Smooth scroll */
html {
    scroll-behavior: smooth;
}

/* Focus states for accessibility */
.nav-link:focus,
.btn-toggle:focus,
.user-info:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* ============================================
   5. RESPONSIVE ADJUSTMENTS
   ============================================ */

@media (max-width: 768px) {
    #sidebar {
        width: 100%;
        padding: 1rem !important;
    }
    
    #sidebar:hover {
        width: 100%;
    }
    
    #sidebar .desktop-logo {
        display: block;
    }
    
    #sidebar .mobile-logo {
        display: none;
    }
    
    #selectBusinessId {
        opacity: 1;
        width: 100%;
        height: auto;
    }
    
    #sidebar .sidebar-text {
        opacity: 1;
    }
    
    .user-dropdown-menu {
        min-width: 240px;
    }
}
