/* Vertical Sidebar Navigation Styles */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #fafbfc;
}

/* Main Layout Structure */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* Vertical Sidebar */
.sidebar {
    width: 280px;
    background: #e2e8f0;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.1);
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    border-right: 1px solid #cbd5e1;
}

.sidebar.collapsed {
    width: 70px;
}

/* Logo Section */
.sidebar-logo {
    padding: 24px 20px;
    border-bottom: 1px solid #cbd5e1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo img {
    max-height: 40px;
    max-width: 100%;
    transition: all 0.3s ease;
}

.sidebar.collapsed .sidebar-logo img {
    max-height: 32px;
}

/* Navigation Menu */
.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

.sidebar-nav::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.sidebar-nav::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 2px;
}

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

.nav-item {
    margin: 4px 16px;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    color: #475569;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    position: relative;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
}

.nav-link:hover {
    background: #cbd5e1;
    color: #1e293b;
    text-decoration: none;
    transform: translateX(4px);
}

.nav-link.active {
    background: #3b82f6;
    color: #ffffff;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.3);
}

.nav-link i {
    font-size: 18px;
    margin-right: 12px;
    width: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.nav-text {
    flex: 1;
    transition: all 0.3s ease;
}

.nav-arrow {
    font-size: 12px;
    transition: all 0.3s ease;
    color: #64748b;
    cursor: pointer;
}

.sidebar.collapsed .nav-arrow {
    cursor: default;
}

.nav-item.has-submenu .nav-arrow {
    transform: rotate(0deg);
}

.nav-item.has-submenu.open .nav-arrow {
    transform: rotate(90deg);
}

/* Collapsed sidebar styles */
.sidebar.collapsed .nav-text,
.sidebar.collapsed .nav-arrow {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-link {
    justify-content: center;
    padding: 12px;
}

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

/* Submenu */
.submenu {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.submenu.open {
    max-height: 500px;
    padding: 4px 0;
}

.submenu-item {
    margin: 2px 0;
}

.submenu-link {
    display: flex;
    align-items: center;
    padding: 8px 16px 8px 48px;
    color: #64748b;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 13px;
    position: relative;
}

.submenu-link:hover {
    background: #f1f5f9;
    color: #1e293b;
    text-decoration: none;
    padding-left: 52px;
}

.submenu-link.active {
    background: #3b82f6;
    color: #ffffff;
}

.submenu-link:before {
    content: '';
    width: 4px;
    height: 4px;
    background: #94a3b8;
    border-radius: 50%;
    margin-right: 12px;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 280px;
    transition: all 0.3s ease;
    min-height: 100vh;
    background: #fafbfc;
}

.main-content.expanded {
    margin-left: 70px;
}

/* Top Header */
.top-header {
    background: #ffffff;
    height: 70px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #6b7280;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-right: 16px;
}

.sidebar-toggle:hover {
    background: #f3f4f6;
    color: #374151;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Header Actions */
.header-action {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.header-action:hover {
    background: #e2e8f0;
    text-decoration: none;
    color: #334155;
}

.header-action i {
    font-size: 16px;
}

/* Notification Badge */
.notification-badge {
    position: relative;
}

.notification-badge .badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    line-height: 1.2;
}

/* User Profile Dropdown */
.user-profile {
    display: flex;
    align-items: center;
    padding: 8px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.user-profile:hover {
    background: #f3f4f6;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 8px;
}

.user-info {
    display: flex;
    flex-direction: column;
    margin-right: 8px;
}

.user-name {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    line-height: 1.2;
}

.user-role {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.2;
}

.dropdown-arrow {
    font-size: 12px;
    color: #6b7280;
    transition: all 0.3s ease;
}

/* Content Wrapper */
.content-wrapper {
    padding: 24px;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

@media (max-width: 768px) {
    .top-header {
        padding: 0 16px;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .user-info {
        display: none;
    }
    
    .header-action .button-text {
        display: none;
    }
}

/* Tooltip for collapsed sidebar */
.nav-tooltip {
    position: absolute;
    left: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: #1e293b;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1001;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.nav-tooltip:before {
    content: '';
    position: absolute;
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    border: 4px solid transparent;
    border-right-color: #1e293b;
}

/* Show tooltips when sidebar is collapsed and hovering over nav link */
.sidebar.collapsed .nav-link:hover .nav-tooltip {
    opacity: 1;
    visibility: visible;
}

/* Animation and transitions */
.fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Modern button styles */
.btn-modern {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary-modern {
    background: #3b82f6;
    color: white;
}

.btn-primary-modern:hover {
    transform: translateY(-2px);
    background: #2563eb;
    box-shadow: 0 10px 25px rgba(59, 130, 246, 0.3);
    color: white;
    text-decoration: none;
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.status-active { background: #10b981; }
.status-pending { background: #f59e0b; }
.status-inactive { background: #ef4444; }

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

.loading:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Override existing styles for compatibility */
body.vertical-nav {
    padding-bottom: 0 !important;
}

body.vertical-nav .wrapper {
    padding: 0 !important;
}

/* Hide old navigation when new one is active */
.app-layout #topnav {
    display: none !important;
}

/* Ensure dropdowns work properly */
.dropdown-menu {
    z-index: 1050;
}

/* Ensure modals appear above the sidebar */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1050 !important;
}

/* Specific styles for app update modal */
#appUpdateNotificationModal {
    z-index: 1060 !important;
}

#appUpdateNotificationModal .modal-backdrop {
    z-index: 1055 !important;
}

/* Fix for existing Angular UI elements */
.app-layout .container-fluid {
    padding: 0;
    max-width: 100%;
}

/* Ensure proper spacing for content */
.content-wrapper .row {
    margin: 0;
}

.content-wrapper .col-12 {
    padding: 0;
}

/* Override any existing fixed positioning */
.app-layout .footer {
    position: relative !important;
    left: 0 !important;
    margin-left: 0 !important;
}

/* Mobile navigation fixes */
@media (max-width: 1024px) {
    .main-content {
        margin-left: 0 !important;
    }
    
    .sidebar.mobile-open {
        z-index: 1050;
    }
}

 