/* =============================================
   PRIVATE HEADER STYLES - AHDA Knowledge Hub
   Modern, Clean, Professional Design
   ============================================= */

/* ===== VARIABLES ===== */
:root {
    --ahda-primary: #8B0000;
    --ahda-primary-dark: #5A0000;
    --ahda-primary-light: #a52a2a;
    --ahda-secondary: #1a1a2e;
    --ahda-gray-100: #f8f9fa;
    --ahda-gray-200: #e9ecef;
    --ahda-gray-300: #dee2e6;
    --ahda-gray-400: #ced4da;
    --ahda-gray-500: #adb5bd;
    --ahda-gray-600: #6c757d;
    --ahda-gray-700: #495057;
    --ahda-gray-800: #343a40;
    --ahda-gray-900: #212529;
    
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
    --shadow-xl: 0 12px 36px rgba(0,0,0,0.15);
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ===== TOP NAVIGATION BAR ===== */
.ahda-header .navbar {
    background: linear-gradient(135deg, var(--ahda-primary) 0%, var(--ahda-primary-dark) 100%);
    padding: 0.75rem 0;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Navbar Brand */
.ahda-header .navbar-brand {
    font-size: 1.35rem;
    font-weight: 700;
    color: white !important;
    transition: var(--transition-fast);
    padding: 0.5rem 0;
    letter-spacing: -0.3px;
}

.ahda-header .navbar-brand:hover {
    transform: translateY(-1px);
    opacity: 0.95;
}

.ahda-header .navbar-brand i {
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

/* ===== NOTIFICATION BUTTON ===== */
.ahda-header .dropdown .btn-light {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 12px;
    padding: 0.5rem 0.85rem;
    transition: var(--transition-fast);
    color: white;
    position: relative;
}

.ahda-header .dropdown .btn-light:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.ahda-header .dropdown .btn-light i {
    font-size: 1.1rem;
    color: white;
}

/* Notification Badge */
.ahda-header .dropdown .btn-light .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 20px;
    min-width: 18px;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Notification Dropdown */
.ahda-header .dropdown-menu {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    margin-top: 10px;
    overflow: hidden;
    animation: slideDown 0.25s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ahda-header .dropdown-menu .dropdown-header {
    background: linear-gradient(135deg, var(--ahda-primary), var(--ahda-primary-dark));
    color: white;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.85rem;
}

/* Notification Items */
.notification-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--ahda-gray-200);
    transition: var(--transition-fast);
    cursor: pointer;
}

.notification-item:hover {
    background: var(--ahda-gray-100);
}

.notification-item.unread {
    background: rgba(139, 0, 0, 0.05);
    border-left: 3px solid var(--ahda-primary);
}

.notification-title {
    font-weight: 600;
    font-size: 0.85rem;
    margin-bottom: 4px;
    color: var(--ahda-gray-800);
}

.notification-message {
    font-size: 0.75rem;
    color: var(--ahda-gray-600);
    margin-bottom: 4px;
}

.notification-time {
    font-size: 0.7rem;
    color: var(--ahda-gray-500);
}

/* ===== USER MENU BUTTON ===== */
.ahda-header .dropdown .dropdown-toggle.d-flex {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    border-radius: 40px;
    padding: 0.4rem 1rem 0.4rem 0.6rem;
    transition: var(--transition-fast);
    color: white;
}

.ahda-header .dropdown .dropdown-toggle.d-flex:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.ahda-header .dropdown .dropdown-toggle i:first-child {
    font-size: 1.25rem;
}

.ahda-header .dropdown .dropdown-toggle span {
    font-weight: 500;
    font-size: 0.9rem;
}

/* User Dropdown Menu */
.ahda-header .dropdown-menu-end {
    min-width: 260px;
    padding: 0.5rem;
    margin-top: 10px;
}

.ahda-header .dropdown-item {
    padding: 0.7rem 1rem;
    border-radius: 10px;
    transition: var(--transition-fast);
    font-size: 0.85rem;
    display: flex;
    align-items: center;
}

.ahda-header .dropdown-item i {
    width: 24px;
    font-size: 1rem;
    color: var(--ahda-primary);
    transition: var(--transition-fast);
}

.ahda-header .dropdown-item:hover {
    background: var(--ahda-gray-100);
    transform: translateX(4px);
}

.ahda-header .dropdown-item:hover i {
    transform: scale(1.1);
}

.ahda-header .dropdown-item.text-danger i {
    color: #dc3545;
}

.ahda-header .dropdown-divider {
    margin: 0.5rem 0;
}

/* Admin Panel Link */
.ahda-header .dropdown-item:has(i.fa-cog) {
    background: linear-gradient(135deg, rgba(139,0,0,0.05), rgba(90,0,0,0.05));
}

/* ===== SIDEBAR ===== */
.ahda-header .sidebar {
    position: fixed;
    left: 0;
    top: 70px;
    width: 280px;
    height: calc(100vh - 70px);
    background: white;
    box-shadow: var(--shadow-md);
    overflow-y: auto;
    transition: var(--transition-normal);
    z-index: 1020;
}

/* Sidebar Scrollbar */
.ahda-header .sidebar::-webkit-scrollbar {
    width: 5px;
}

.ahda-header .sidebar::-webkit-scrollbar-track {
    background: var(--ahda-gray-200);
}

.ahda-header .sidebar::-webkit-scrollbar-thumb {
    background: var(--ahda-primary);
    border-radius: 10px;
}

/* Sidebar Menu */
.ahda-header .sidebar-menu {
    padding: 1.5rem 1rem;
}

/* Sidebar Items */
.ahda-header .sidebar-item {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    margin-bottom: 0.5rem;
    color: var(--ahda-gray-700);
    text-decoration: none;
    border-radius: 12px;
    transition: var(--transition-fast);
    font-weight: 500;
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.ahda-header .sidebar-item i {
    width: 28px;
    font-size: 1.1rem;
    margin-right: 12px;
    transition: var(--transition-fast);
}

.ahda-header .sidebar-item span {
    flex: 1;
}

/* Sidebar Item Hover */
.ahda-header .sidebar-item:hover {
    background: linear-gradient(135deg, rgba(139,0,0,0.08), rgba(90,0,0,0.04));
    color: var(--ahda-primary);
    transform: translateX(5px);
}

.ahda-header .sidebar-item:hover i {
    color: var(--ahda-primary);
    transform: scale(1.1);
}

/* Active Sidebar Item */
.ahda-header .sidebar-item.active {
    background: linear-gradient(135deg, var(--ahda-primary), var(--ahda-primary-dark));
    color: white;
    box-shadow: var(--shadow-sm);
}

.ahda-header .sidebar-item.active i {
    color: white;
}

.ahda-header .sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: white;
    border-radius: 0 4px 4px 0;
}

/* ===== DASHBOARD WRAPPER ===== */
.dashboard-wrapper {
    margin-left: 280px;
    padding: 1.5rem;
    background: var(--ahda-gray-100);
    min-height: calc(100vh - 70px);
    transition: var(--transition-normal);
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .ahda-header .sidebar {
        width: 240px;
    }
    
    .dashboard-wrapper {
        margin-left: 240px;
        padding: 1.25rem;
    }
}

/* Mobile (< 768px) */
@media (max-width: 768px) {
    /* Top Navbar */
    .ahda-header .navbar-brand span {
        font-size: 1rem;
    }
    
    .ahda-header .dropdown .dropdown-toggle.d-flex span {
        display: none;
    }
    
    .ahda-header .dropdown .dropdown-toggle.d-flex {
        padding: 0.4rem 0.6rem;
        border-radius: 50%;
    }
    
    .ahda-header .dropdown .dropdown-toggle.d-flex i:first-child {
        margin-right: 0;
    }
    
    /* Sidebar - Hidden by default, show with hamburger */
    .ahda-header .sidebar {
        transform: translateX(-100%);
        width: 280px;
        z-index: 1040;
        box-shadow: var(--shadow-xl);
    }
    
    .ahda-header .sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-wrapper {
        margin-left: 0;
        padding: 1rem;
    }
    
    /* Mobile Menu Toggle Button */
    .mobile-menu-toggle {
        display: block;
        background: rgba(255,255,255,0.15);
        border: none;
        border-radius: 10px;
        padding: 0.5rem 0.75rem;
        margin-right: 1rem;
        color: white;
        cursor: pointer;
    }
}

/* Desktop (> 768px) */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none;
    }
}

/* Small Mobile (< 480px) */
@media (max-width: 480px) {
    .dashboard-wrapper {
        padding: 0.75rem;
    }
    
    .ahda-header .dropdown-menu {
        width: 300px !important;
        position: fixed;
        right: 10px;
        left: auto !important;
    }
    
    .ahda-header .dropdown-menu-end {
        min-width: 280px;
    }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Sidebar items animation */
.ahda-header .sidebar-item {
    animation: slideInLeft 0.3s ease backwards;
}

.ahda-header .sidebar-item:nth-child(1) { animation-delay: 0.05s; }
.ahda-header .sidebar-item:nth-child(2) { animation-delay: 0.1s; }
.ahda-header .sidebar-item:nth-child(3) { animation-delay: 0.15s; }
.ahda-header .sidebar-item:nth-child(4) { animation-delay: 0.2s; }
.ahda-header .sidebar-item:nth-child(5) { animation-delay: 0.25s; }
.ahda-header .sidebar-item:nth-child(6) { animation-delay: 0.3s; }

/* ===== ACTIVE STATE INDICATORS ===== */
.ahda-header .sidebar-item.active i {
    animation: iconPulse 0.5s ease;
}

@keyframes iconPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* ===== TOOLTIP STYLES ===== */
.ahda-header .sidebar-item[data-tooltip] {
    position: relative;
}

.ahda-header .sidebar-item[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 100%;
    top: 50%;
    transform: translateY(-50%);
    background: var(--ahda-gray-800);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    white-space: nowrap;
    margin-left: 8px;
    z-index: 1000;
}

/* ===== LOADING STATES ===== */
.notification-loading {
    text-align: center;
    padding: 2rem;
    color: var(--ahda-gray-500);
}

.notification-loading i {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* ===== EMPTY STATES ===== */
.empty-notifications {
    text-align: center;
    padding: 2rem;
    color: var(--ahda-gray-500);
}

.empty-notifications i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    opacity: 0.5;
}

/* ===== DROPDOWN ANIMATIONS ===== */
.dropdown-menu {
    animation: dropdownFade 0.2s ease;
}

@keyframes dropdownFade {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}