/* ============================================
   NAV.CSS — Sistema de navegación global
   Header + Breadcrumbs + Mobile menu
   ============================================ */

/* ---- Header Global (siempre fixed, nunca cambia) ---- */
.nav-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 9000;
    background: linear-gradient(135deg, #00A0DC 0%, #0F4A69 100%);
    color: white;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Reserva espacio para el header fixed */
#nav-container {
    flex-shrink: 0;
    min-height: 56px;
}

.nav-header-inner {
    width: 100%;
    margin: 0;
    padding: 0 0.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 0;
    position: relative;
}

/* Logo */
.nav-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-logo img {
    width: 28px;
    height: 28px;
    background: white;
    border-radius: 4px;
    padding: 2px;
}

.nav-logo:hover {
    opacity: 0.9;
}

/* Desktop nav links (centered) */
.nav-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-weight: 600;
}

.nav-link i {
    font-size: 0.9rem;
}

/* Right actions */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-right: 16px;
}

.nav-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
    text-decoration: none;
}

.nav-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-action-btn.primary {
    background: white;
    color: #0F4A69;
}

.nav-action-btn.primary:hover {
    background: #e8f4fd;
}

/* Guest access buttons */
.nav-access-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.nav-access-candidatos {
    background: white;
    color: #0077B5;
}

.nav-access-candidatos:hover {
    background: #e8f4fd;
}

.nav-access-empresas {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
}

.nav-access-empresas:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* User dropdown */
.nav-user-menu {
    position: relative;
}

.nav-user-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 44px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    min-width: 210px;
    z-index: 9999;
    overflow: hidden;
    animation: navDropdownIn 0.15s ease;
}

.nav-user-dropdown.open {
    display: block;
}

@keyframes navDropdownIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.nav-user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.nav-user-dropdown a:last-child {
    border-bottom: none;
}

.nav-user-dropdown a:hover {
    background: #f8f9fa;
}

.nav-user-dropdown a.danger {
    color: #dc3545;
}

.nav-user-dropdown a i {
    width: 18px;
    text-align: center;
    font-size: 0.9rem;
}

/* Hamburger (mobile) */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    color: white;
    font-size: 1.3rem;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s;
}

.nav-hamburger:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Mobile menu overlay */
.nav-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 8999;
    background: rgba(0, 0, 0, 0.4);
    animation: navFadeIn 0.2s ease;
}

.nav-mobile-overlay.open {
    display: block;
}

@keyframes navFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.nav-mobile-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 85vw;
    height: 100vh;
    background: white;
    z-index: 9001;
    box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.25s ease, visibility 0.25s ease;
}

.nav-mobile-panel.open {
    transform: translateX(0);
    visibility: visible;
}

.nav-mobile-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #eee;
}

.nav-mobile-header h3 {
    font-size: 1rem;
    color: #333;
    margin: 0;
}

.nav-mobile-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: #f0f0f0;
    color: #555;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-mobile-links {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-mobile-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #333;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s;
}

.nav-mobile-links a:hover,
.nav-mobile-links a.active {
    background: #f0f7ff;
    color: #0077B5;
}

.nav-mobile-links a.active {
    font-weight: 600;
    border-left: 3px solid #0077B5;
}

.nav-mobile-links a i {
    width: 20px;
    text-align: center;
    font-size: 1rem;
}

.nav-mobile-divider {
    height: 1px;
    background: #eee;
    margin: 6px 16px;
}

.nav-mobile-links a.danger {
    color: #dc3545;
}

/* ---- Profile icon button (icon-only) ---- */
.nav-profile-icon-btn {
    width: 38px !important;
    height: 38px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all 0.2s;
}

/* ---- Notification bell ---- */
.nav-notif-btn {
    position: relative;
    font-size: 1.05rem;
}

.nav-notif-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #dc3545;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #0F4A69;
    line-height: 1;
    animation: navBadgePulse 2s ease-in-out infinite;
}

@keyframes navBadgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* ---- Notification dropdown ---- */
.nav-notif-menu {
    position: relative;
}

.nav-notif-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 44px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.18);
    min-width: 300px;
    max-width: 360px;
    z-index: 9999;
    overflow: hidden;
    animation: navDropdownIn 0.15s ease;
}

.nav-notif-dropdown.open {
    display: block;
}

.nav-notif-dropdown-header {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    background: linear-gradient(135deg, #0077B5 0%, #005885 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-notif-dropdown-header h4 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-notif-header-actions {
    display: flex;
    gap: 4px;
}

.nav-notif-header-btn {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s;
    backdrop-filter: blur(4px);
}

.nav-notif-header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.nav-notif-dropdown-body {
    max-height: 280px;
    overflow-y: auto;
    padding: 8px 0;
}

.nav-notif-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: #999;
}

.nav-notif-empty i {
    font-size: 2rem;
    margin-bottom: 8px;
    display: block;
    color: #ccc;
}

.nav-notif-empty p {
    font-size: 0.88rem;
    margin: 0;
}

/* ---- Notification items ---- */
.nav-notif-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 16px;
    transition: background 0.15s, opacity 0.2s, max-height 0.3s;
    border-bottom: 1px solid #f5f5f5;
    cursor: pointer;
    position: relative;
    border-left: 3px solid #0077B5;
}

.nav-notif-item.read {
    border-left-color: transparent;
    opacity: 0.65;
}

.nav-notif-item.read:hover {
    opacity: 0.85;
}

.nav-notif-item:last-child {
    border-bottom: none;
}

.nav-notif-item:hover {
    background: #f0f7fc;
}

.nav-notif-item-icon {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border-radius: 50%;
    background: #f0f4f8;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    margin-top: 2px;
}

.nav-notif-item.read .nav-notif-item-icon {
    background: #f5f5f5;
}

.nav-notif-item-content {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.nav-notif-item-text {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.35;
    margin: 0;
}

.nav-notif-item.read .nav-notif-item-text {
    color: #888;
}

.nav-notif-item.read .nav-notif-item-text strong {
    color: #666;
}

.nav-notif-item-text strong {
    color: #0077B5;
    font-weight: 600;
}

.nav-notif-item-time {
    font-size: 0.75rem;
    color: #999;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 3px;
}

/* Notification item action buttons */
.nav-notif-item-actions {
    display: flex;
    gap: 2px;
    align-items: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.15s;
}

.nav-notif-item:hover .nav-notif-item-actions {
    opacity: 1;
}

.nav-notif-action-btn {
    background: none;
    border: none;
    color: #aaa;
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.72rem;
    transition: all 0.15s;
}

.nav-notif-action-btn:hover {
    background: #e8f4fd;
    color: #0077B5;
}

.nav-notif-action-btn.dismiss:hover {
    background: #ffeaea;
    color: #dc3545;
}

.nav-notif-dropdown-footer {
    border-top: 1px solid #f0f0f0;
    padding: 0;
}

.nav-notif-dropdown-footer a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    color: #0077B5;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background 0.15s;
}

.nav-notif-dropdown-footer a:hover {
    background: #f0f7fc;
}

.nav-profile-icon-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.7);
}

.nav-profile-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}



/* Mobile map button (visible only on mobile) */
.nav-mobile-map-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: white;
    text-decoration: none;
    font-size: 1rem;
    transition: background 0.2s;
}

.nav-mobile-map-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}



/* ---- Responsive ---- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .nav-hamburger {
        display: flex;
    }

    .nav-mobile-map-btn {
        display: flex;
    }

    .nav-header-inner {
        height: 50px;
        padding: 0 0.75rem;
    }

    .nav-logo {
        font-size: 1rem;
    }

    .nav-profile-icon-btn {
        width: 34px !important;
        height: 34px !important;
        font-size: 1.1rem;
    }

    #nav-container {
        min-height: 50px;
    }

    .nav-access-btn {
        display: none;
    }
}
