/* ========================================
   UNIFIED NAVBAR CSS - Works for all pages
   ======================================== */

/* Sidebar Base Styles */
.maritime-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 240px;
    height: 100vh;
    background: rgba(240, 244, 248, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-right: 1px solid #e0e7ff;
    z-index: 1100;
    transition: all 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

body.ocean-dark-mode .maritime-sidebar {
    background: rgba(30, 41, 59, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

/* Sidebar Header */
.maritime-sidebar-header {
    padding-left: 16px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 20px;
    border-bottom: 1px solid #e0e7ff;
    min-height: 70px;
    box-sizing: border-box;
}

body.ocean-dark-mode .maritime-sidebar-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Logo Icon and Text */
.ocean-logo-icon {
    width: 32px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 18px;
    flex-shrink: 0;
    gap: 5px;
}

.logo-light {
    display: inline-block;
}
.logo-dark {
    display: none;
}

/* When dark mode is active */
body.ocean-dark-mode .logo-light {
    display: none;
}
body.ocean-dark-mode .logo-dark {
    display: inline-block;
    height: 32px;
    width: 70px;
    margin-left: 12px;
}
.ocean-logo-text {
    display: flex;
    flex-direction: column;
    transition: opacity 0.3s ease, width 0.3s ease;
}

.ocean-logo-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e40af;
    line-height: 1.2;
}

body.ocean-dark-mode .ocean-logo-title {
    color: #3b82f6;
}

.ocean-logo-subtitle {
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
}

body.ocean-dark-mode .ocean-logo-subtitle {
    color: #94a3b8;
}

/* Sidebar Section and Label */
.maritime-sidebar-section {
    padding: 16px 0;
    border-bottom: 1px solid rgba(224, 231, 255, 0.5);
    flex-grow: 0;
}

body.ocean-dark-mode .maritime-sidebar-section {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.maritime-sidebar-section:last-child {
    border-bottom: none;
}

.ocean-section-label {
    padding: 8px 16px;
    font-size: 11px;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: opacity 0.3s ease, height 0.3s ease;
}

body.ocean-dark-mode .ocean-section-label {
    color: #94a3b8;
}

/* Sidebar Menu */
.ocean-sidebar-menu {
    list-style: none;
    padding: 8px;
    margin: 0;
}

.ocean-sidebar-menu li {
    margin-bottom: 4px;
}

/* Navigation Links */
.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: #1e40af;
    font-size: 14px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

body.ocean-dark-mode .nav-link {
    color: rgba(226, 232, 240, 0.9);
}

/* Icons */
.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: inherit;
    flex-shrink: 0;
}

/* Text Spans */
.nav-link span {
    transition: opacity 0.3s ease, font-size 0.3s ease;
    white-space: nowrap;
    flex-grow: 1;
}

/* Active State */
.nav-link.active {
    background: rgba(219, 234, 254, 0.8);
    color: #1e40af;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 58, 138, 0.15);
}

body.ocean-dark-mode .nav-link.active {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
}

/* Hover State */
.nav-link:hover {
    background: rgba(224, 231, 255, 0.6);
    transform: translateX(4px);
}

body.ocean-dark-mode .nav-link:hover {
    background: rgba(59, 130, 246, 0.15);
}

/* Sidebar Toggle Button (Desktop only) */
.ocean-sidebar-toggle {
    position: absolute;
    right: 0px;
    top: 20px;
    width: 32px;
    height: 48px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border: 1px solid #e0e7ff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 1101;
    color: #1e40af;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.ocean-dark-mode .ocean-sidebar-toggle {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #3b82f6;
}

.ocean-sidebar-toggle:hover {
    background: rgba(224, 231, 255, 0.9);
    transform: translateX(2px);
}

body.ocean-dark-mode .ocean-sidebar-toggle:hover {
    background: rgba(59, 130, 246, 0.3);
}

.ocean-sidebar-toggle i {
    font-size: 16px;
    transition: transform 0.3s ease;
}

/* Top Navbar */
.ocean-top-navbar {
    position: fixed;
    top: 0;
    left: 240px;
    right: 0;
    height: 70px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(224, 231, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 999;
    transition: left 0.3s ease;
    box-sizing: border-box;
}

body.ocean-dark-mode .ocean-top-navbar {
    background: rgba(30, 41, 59, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Navbar Left and Breadcrumb */
.ocean-navbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.ocean-breadcrumb {
    font-size: 16px;
    color: #1e40af;
    font-weight: 600;
    line-height: 1.5;
}

body.ocean-dark-mode .ocean-breadcrumb {
    color: #e2e8f0;
}

/* Hamburger Menu (Hidden by default) */
.ocean-hamburger-menu {
    display: none;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 24px;
    color: #1e40af;
    background: transparent;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.3s ease;
}

body.ocean-dark-mode .ocean-hamburger-menu {
    color: #e2e8f0;
}

.ocean-hamburger-menu:hover {
    color: #3b82f6;
}

body.ocean-dark-mode .ocean-hamburger-menu:hover {
    color: #64b5f6;
}

/* Navbar Right and Profile Button */
.ocean-navbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

/* Profile Button */
.ocean-profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.ocean-profile-btn:hover {
    transform: scale(1.05);
}

.ocean-profile-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

body.ocean-dark-mode .ocean-profile-avatar {
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* Dropdown Menu */
.ocean-dropdown-menu {
    position: absolute;
    top: 48px;
    right: 16px;
    width: 200px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.3s ease;
    z-index: 1101;
}

body.ocean-dark-mode .ocean-dropdown-menu {
    background: rgba(30, 41, 59, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

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

.ocean-dropdown-item {
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: #1e40af;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.ocean-dropdown-item a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
}

body.ocean-dark-mode .ocean-dropdown-item {
    color: #e2e8f0;
}

.ocean-dropdown-item:hover {
    background: rgba(224, 231, 255, 0.8);
}

body.ocean-dark-mode .ocean-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.2);
}

.ocean-dropdown-item i {
    width: 18px;
    font-size: 14px;
    flex-shrink: 0;
}

/* Overlay */
.ocean-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    z-index: 1050;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.ocean-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Desktop - Collapsed State (769px and above) */
@media (min-width: 769px) {
    .maritime-sidebar.collapsed {
        width: 80px;
    }
    
    .maritime-sidebar.collapsed .ocean-logo-text {
        opacity: 0;
        width: 0;
        overflow: hidden;
    }
    
    .maritime-sidebar.collapsed .ocean-section-label {
        opacity: 0;
        height: 0;
        padding: 0;
        overflow: hidden;
    }
    
    .maritime-sidebar.collapsed .nav-link {
        padding: 12px 8px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
    }
    
    .maritime-sidebar.collapsed .nav-link i {
        font-size: 20px;
        width: 24px;
    }
    
    .maritime-sidebar.collapsed .nav-link span {
        font-size: 11px;
        opacity: 1;
        white-space: normal;
        max-width: 60px;
        text-align: center;
        line-height: 1.2;
    }
    
    .maritime-sidebar.collapsed ~ .ocean-top-navbar {
        left: 80px;
    }
    
    .maritime-sidebar.collapsed .ocean-sidebar-toggle {
        right: 0px;
    }
    
    /* Hide hamburger on desktop */
    .ocean-hamburger-menu {
        display: none !important;
    }
}

/* Tablet (769px to 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .maritime-sidebar {
        width: 220px;
    }
    
    .ocean-top-navbar {
        left: 220px;
    }
    
    .maritime-sidebar.collapsed {
        width: 70px;
    }
    
    .maritime-sidebar.collapsed ~ .ocean-top-navbar {
        left: 70px;
    }
    
    .maritime-sidebar.collapsed .nav-link span {
        font-size: 10px;
        max-width: 50px;
    }
}

/* Mobile and Small Screens (max 768px) */
@media (max-width: 768px) {
    /* Hide sidebar by default on mobile */
    .maritime-sidebar {
        width: 260px;
        left: -260px;
        transition: left 0.3s ease;
    }
    
    .maritime-sidebar.active {
        left: 0;
    }
    
    /* Top navbar takes full width */
    .ocean-top-navbar {
        left: 0;
        height: 60px;
        padding: 0 16px;
    }
    
    /* Show hamburger menu on mobile */
    .ocean-hamburger-menu {
        display: flex;
    }
    
    /* Hide desktop toggle button on mobile */
    .ocean-sidebar-toggle {
        display: none;
    }
    
    /* Smaller elements on mobile */
    .ocean-breadcrumb {
        font-size: 14px;
    }
    
    .ocean-profile-btn,
    .ocean-profile-avatar {
        width: 32px;
        height: 32px;
    }
    
    .ocean-dropdown-menu {
        width: 180px;
        top: 45px;
        right: 12px;
    }
    
    .ocean-dropdown-item {
        font-size: 12px;
        padding: 10px 14px;
    }
    
    /* Ensure collapsed styles don't apply on mobile */
    .maritime-sidebar.collapsed {
        width: 260px;
        left: -260px;
    }
    
    .maritime-sidebar.collapsed.active {
        left: 0;
    }
    
    .maritime-sidebar.collapsed .nav-link {
        padding: 10px 12px;
        flex-direction: row;
        justify-content: flex-start;
        align-items: center;
    }
    
    .maritime-sidebar.collapsed .nav-link span {
        opacity: 1;
        font-size: 14px;
        max-width: none;
        text-align: left;
    }
    
    .maritime-sidebar.collapsed .ocean-logo-text {
        opacity: 1;
        width: auto;
    }
    
    .maritime-sidebar.collapsed .ocean-section-label {
        opacity: 1;
        height: auto;
        padding: 8px 16px;
    }
}

/* Extra Small Screens (max 480px) */
@media (max-width: 480px) {
    .maritime-sidebar {
        width: 240px;
        left: -240px;
    }
    
    .maritime-sidebar.active {
        left: 0;
    }
    
    .ocean-top-navbar {
        height: 56px;
        padding: 0 12px;
    }
    
    .ocean-breadcrumb {
        font-size: 13px;
    }
    
    .ocean-profile-btn,
    .ocean-profile-avatar {
        width: 30px;
        height: 30px;
    }
    
    .ocean-hamburger-menu {
        width: 28px;
        height: 28px;
        font-size: 20px;
    }
    
    .maritime-sidebar-header {
        padding: 12px 16px;
    }
    
    .ocean-logo-icon {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
    
    .ocean-logo-title {
        font-size: 14px;
    }
    
    .ocean-logo-subtitle {
        font-size: 10px;
    }
    
    .nav-link {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .nav-link i {
        font-size: 16px;
        width: 22px;
    }
    
    .ocean-dropdown-menu {
        width: 160px;
        top: 42px;
        right: 8px;
    }
}

/* Large Screens (1200px+) */
@media (min-width: 1200px) {
    .maritime-sidebar {
        width: 260px;
    }
    
    .ocean-top-navbar {
        left: 260px;
    }
    
    .maritime-sidebar.collapsed {
        width: 90px;
    }
    
    .maritime-sidebar.collapsed ~ .ocean-top-navbar {
        left: 90px;
    }
    
    .ocean-logo-title {
        font-size: 16px;
    }
    
    .ocean-logo-subtitle {
        font-size: 12px;
    }
    
    .nav-link {
        font-size: 15px;
        padding: 12px 16px;
    }
    
    .nav-link i {
        font-size: 20px;
        width: 26px;
    }
    
    .maritime-sidebar.collapsed .nav-link span {
        font-size: 11px;
        max-width: 70px;
    }
}
/* Ensure sidebar is not hidden by other rules */
@media (max-width: 768px) {
    .maritime-sidebar {
        visibility: visible; /* Override any visibility: hidden */
        display: flex !important; /* Override any display: none */
    }

    /* Ensure overlay doesn't block hamburger */
    .ocean-overlay.active {
        pointer-events: auto; /* Allow clicks on overlay */
    }

    /* Ensure hamburger is clickable */
    .ocean-hamburger-menu {
        z-index: 1200; /* Above sidebar and overlay */
        position: relative;
    }
}

/* FIX: Ensure sidebar toggle button stays visible and above navbar */
.ocean-sidebar-toggle {
    position: fixed !important; /* keeps it in place even if content scrolls */
    top: 80px !important; /* push slightly below the top navbar height */
    z-index: 1200 !important; /* above sidebar and top navbar */
}

body.sidebar-collapsed .ocean-sidebar-toggle {
    top: 80px !important; /* keep same position when collapsed */
}
