/**
 * Unified Header Component
 * Standardized header design for all admin dashboards
 * v1.0.0
 *
 * Structure:
 * - Top Bar (white): ShuttleWorks logo + user info + Sign Out
 * - Header Bar (purple gradient): Page title + Hamburger menu
 */

/* === TOP BAR (White background) === */
.top-bar {
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 10px 20px;
}

.top-bar-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Logo + User Display (Left Side) */
.top-bar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.user-info-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-company {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    line-height: 1.2;
}

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

/* Sign Out Button (Right Side of Top Bar) */
.sign-out-btn {
    background: #dc2626;
    border: none;
    color: white;
    padding: 8px 18px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.sign-out-btn:hover {
    background: #b91c1c;
}

.sign-out-btn:active {
    transform: scale(0.95);
}

/* === HEADER BAR (Purple gradient) === */
.app-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}

.app-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.app-header-title {
    font-size: 22px;
    font-weight: 600;
    color: white;
    margin: 0;
    flex: 1;
}

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

/* AI Enabled Badge - compact size */
.ai-enabled-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 50%, #f59e0b 100%);
    color: white;
    border: 2px solid #d97706;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
    animation: pulse-glow 2s ease-in-out infinite;
}

.ai-enabled-badge .sparkle {
    font-size: 12px;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 2px 4px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 2px 8px rgba(245, 158, 11, 0.5), 0 0 12px rgba(251, 191, 36, 0.3);
    }
}

/* Hamburger Menu Button */
.hamburger-btn {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.hamburger-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.4);
}

.hamburger-btn:active {
    transform: scale(0.95);
}

/* === HAMBURGER MENU SLIDE-OUT === */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: -320px;
    width: 320px;
    height: 100vh;
    background: #1f2937;
    box-shadow: -4px 0 24px rgba(0,0,0,0.3);
    z-index: 1000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.hamburger-menu.open {
    right: 0;
}

/* Menu Overlay */
.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

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

/* Menu Header */
.menu-header {
    padding: 24px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    position: relative;
}

.menu-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 4px;
}

.menu-subtitle {
    font-size: 13px;
    color: rgba(255,255,255,0.8);
}

/* Menu Close Button */
.menu-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.menu-close-btn:hover {
    background: rgba(255,255,255,0.3);
}

/* Menu Navigation */
.menu-nav {
    padding: 12px 0;
}

.menu-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    color: #e5e7eb;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
    cursor: pointer;
}

.menu-nav-item:hover {
    background: rgba(102, 126, 234, 0.15);
    color: white;
    border-left-color: #667eea;
}

.menu-nav-item.active {
    background: rgba(102, 126, 234, 0.25);
    color: white;
    border-left-color: #667eea;
}

.menu-nav-item-icon {
    font-size: 20px;
    width: 24px;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.menu-nav-item-icon img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
    .top-bar {
        padding: 8px 15px;
    }

    .app-header-content {
        padding: 12px 15px;
    }

    .user-email {
        font-size: 11px;
    }

    .user-company {
        font-size: 13px;
    }

    .app-header-title {
        font-size: 18px;
    }

    .hamburger-menu {
        width: 280px;
        right: -280px;
    }

    .app-logo {
        width: 32px;
        height: 32px;
    }

    .sign-out-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}
