@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --primary:        #1648B9;
    --primary-dark:   #143d9e;
    --primary-light:  #eef3fc;
    --primary-glow:   rgba(22, 72, 185, 0.15);
    --bg:             #ffffff;
    --surface:        #ffffff;
    --surface-2:      #fafafa;
    --text:           #1a1a1a;
    --text-muted:     #6b7280;
    --border:         rgba(22, 72, 185, 0.25);
    --border-subtle:  #e5e7eb;
}

/* ── HEADER ── */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid var(--border-subtle);
    box-shadow: 0 1px 8px rgba(0,0,0,0.06);
    position: sticky;
    top: 0;
    z-index: 100;
    height: 68px;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

/* ── LOGO ── */
.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.logo img { height: 42px; }

.logo a {
    font-family: 'Playfair Display', serif;
    font-size: 1.6rem;
    font-weight: 900;
    text-decoration: none;
    color: var(--text);
    letter-spacing: -0.5px;
}

.logo a span { color: var(--primary); }

/* ── NAV ── */
.user-nav {
    display: flex;
    height: 100%;
    align-items: center;
    gap: 2px;
}

.nav-item {
    font-family: 'DM Sans', sans-serif;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.88rem;
    letter-spacing: 0.2px;
    height: 100%;
    padding: 0 16px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 7px;
    transition: color 0.2s, background 0.2s;
    position: relative;
    cursor: pointer;
}

.nav-item i { color: var(--primary); font-size: 0.8rem; }
.nav-item:hover { color: var(--primary); background: var(--primary-light); }

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 16px; right: 16px;
    height: 2px;
    background: var(--primary);
    transform: scaleX(0);
    transition: transform 0.25s ease;
    border-radius: 2px 2px 0 0;
}

.nav-item:hover::after { transform: scaleX(1); }

.nav-item-login {text-decoration: none; color: var(--primary); border-bottom: 2px solid var(--primary-light);}

.control-container { display: flex; height: 100%; align-items: center }


.notifications-container {
    position: relative;
    display: flex;
    margin-right: 15px; 
}

.notif-btn {
    background: none;
    border: none;
    font-size: 1.25rem;
    color: var(--text-muted, #6c757d);
    cursor: pointer;
    padding: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.notif-btn:hover {
    color: var(--primary, #ff6b6b);
}

.notif-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #e74c3c;
    color: white;
    font-size: 0.65rem;
    font-weight: bold;
    border-radius: 50%;
    padding: 2px 5px;
    line-height: 1;
    min-width: 15px;
    text-align: center;
}

.notif-dropdown {
    position: absolute;
    top: 100%; 
    right: 0;   
    width: 360px;
    height: 400px; 
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    z-index: 1000;
    margin-top: 8px;
    display: none; 
    flex-direction: column;
}

.notif-dropdown.show {
    display: flex;
}

.notif-header {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.mark-all-read {
    font-size: 0.78rem;
    color: var(--primary);
    text-decoration: none;
}

.mark-all-read:hover {
    text-decoration: underline;
}

.notif-body {
    flex: 1; 
    overflow-y: auto; 
    display: flex;
    flex-direction: column;
}

.notif-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #a0aec0;
    padding: 20px;
    text-align: center;
}

.notif-empty i {
    font-size: 2rem;
    margin-bottom: 0.8rem;
    color: #cbd5e0;
}

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

.notif-item {
    display: flex;
    padding: 12px 16px;
    max-height: 90px;
    gap: 12px;
    border-bottom: 1px solid #f8f9fa;
    text-decoration: none;
    background-color: #f8f9fa;
    color: #333;
    transition: background 0.2s;
}

.notif-item:hover {
    background-color: #e9eaeb;
}

.notif-item.unread {
    background-color: var(--primary-light);
}

.notif-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgb(255, 255, 255);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.notif-avatar.system {
    background: #e8f5e9;
    color: #2e7d32;
}

.notif-content p {
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.3;
}

.notif-content strong {
    color: #000;
}

.notif-time {
    font-size: 0.75rem;
    color: #888;
    display: block;
    margin-top: 4px;
}

.notif-footer {
    padding: 10px;
    text-align: center;
    justify-self: end;
    border-top: 1px solid #eee;
    background: #fdfdfd;
    border-radius: 0 0 12px 12px;
}

.notif-footer a {
    font-size: 0.82rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

.notif-footer a:hover {
    color: var(--primary);
}

/* ── USER PROFILE ── */

.user-btn { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-muted);}
.user-btn::after { display: none !important; }
.user-btn img {
    height: 34px; width: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    object-fit: cover;
}

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

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: #f3f4f6; }
::-webkit-scrollbar-thumb { background: rgba(235,126,37,0.4); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }


.hamburger-btn, .close-menu-btn {
    display: none; 
}
.sidebar-overlay {
    display: none;
}

@media (max-width: 768px) {
    .home-page .notifications-container {
        display: none !important;
    }

    .control-container .user-btn.nav-item-profile {
        display: none !important;
    }

    .hamburger-btn {
        display: flex;
        background: none;
        border: none;
        font-size: 1.4rem;
        color: var(--text);
        cursor: pointer;
        padding: 8px;
        margin-left: 10px;
        align-items: center;
        transition: color 0.2s;
    }
    .hamburger-btn:hover {
        color: var(--primary);
    }

    .user-btn span, .nav-item-login {
        font-size: 0.9rem;
    }
    .header-container {
        padding: 0 1rem;
        gap: 0.5rem;
    }

    .user-nav {
        position: fixed;
        top: 0;
        right: -280px;
        width: 250px;
        height: 100vh;
        background: var(--surface);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        border-radius: 16px 0 0 16px;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 80px 1.5rem 2rem;
        gap: 10px;
        z-index: 1001;
        transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-sizing: border-box;
    }

    .user-nav.open {
        right: 0;
    }

    .user-nav .nav-item {
        width: 100%;
        height: auto;
        padding: 12px 16px;
        border-radius: 8px;
        justify-content: flex-start;
        font-size: 1rem;
    }
    .user-nav .nav-item::after {
        display: none;
    }

    .mobile-profile-wrapper {
        width: 100%;
        margin-top: auto;
        padding-top: 1.5rem;
    }

    .menu-divider {
        border: 0;
        height: 1px;
        background: rgba(0, 0, 0, 0.08);
        margin-bottom: 1.2rem;
    }

    .user-btn-mobile {
        display: flex !important;
        align-items: center !important;
        gap: 12px;
        text-decoration: none;
        color: var(--text);
        padding: 10px 14px;
        width: 100%;
        box-sizing: border-box;
        transition: background 0.2s;
    }

    .user-btn-mobile img {
        width: 36px;
        height: 36px;
        border: 2px solid var(--border);
        border-radius: 50%;
        object-fit: cover;
    }

    .user-btn-mobile i {
        margin-left: auto;
        color: var(--text-muted);
    }

    .close-menu-btn {
        display: flex;
        position: absolute;
        top: 18px;
        right: 20px;
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--text-muted);
        cursor: pointer;
        padding: 5px;
    }
    .close-menu-btn:hover {
        color: var(--primary);
    }

    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.4);
        z-index: 1000;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s ease;
        display: block;
    }
    .sidebar-overlay.active {
        opacity: 1;
        pointer-events: auto;
    }

    .notif-dropdown {
        width: 300px;
        right: -40px;
    }
}

@media (min-width: 769px) {
    .mobile-profile-wrapper {
        display: none !important;
    }
}

/* ── BOTONES DE ADMINISTRACIÓN ── */
.admin-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.25rem;
    text-decoration: none;
    padding: 8px;
    margin-left: 10px; /* Empuja el icono a la derecha de tu nombre */
    transition: color 0.2s;
}

.admin-icon-btn:hover {
    color: var(--primary);
}

.admin-icon-btn-mobile {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.3rem;
    text-decoration: none;
    padding: 10px;
    margin-left: 5px;
    transition: color 0.2s;
}

.admin-icon-btn-mobile:hover {
    color: var(--primary);
}

/* Ocultar el icono de escritorio en pantallas móviles para no romper el layout */
@media (max-width: 768px) {
    .admin-icon-btn {
        display: none !important;
    }
}