/**
 * Header Styles for PAM Analyzer
 * Modern header with user dropdown menu
 */

/* Modern Header Styles */
.top-header {
    background: var(--header-bg, #ffffff);
    border-bottom: 1px solid var(--border-color, #e0e0e0);
    padding: 12px 0;
    position: sticky;
    top: 0;
    z-index: 1100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 100%;
    margin: 0;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
    margin-right: auto; /* Push to left */
}

.header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.header-title-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.header-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-primary, #333);
    line-height: 1.2;
}

.header-subtitle {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary, #666);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: auto; /* Push to right */
}

/* Language Switcher - Compact */
.lang-switcher {
    display: flex;
    gap: 5px;
    background: var(--bg-secondary, #f5f5f5);
    padding: 4px;
    border-radius: 6px;
}

.lang-switcher a {
    padding: 4px 10px;
    font-size: 0.85rem;
    border-radius: 4px;
    text-decoration: none;
    color: var(--text-secondary, #666);
    transition: all 0.2s ease;
}

.lang-switcher a.active {
    background: var(--primary-color, #667eea);
    color: white;
}

.lang-switcher a:hover:not(.active) {
    background: var(--hover-bg, #e0e0e0);
}

/* Theme Toggle - Plain Icon Only - Override existing styles */
.theme-toggle {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
    border-radius: 0 !important;
    cursor: pointer;
    font-size: 1.3rem;
    transition: opacity 0.2s ease !important;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
}

.theme-toggle:hover {
    opacity: 1 !important;
    transform: none !important;
    background: none !important;
}

.theme-toggle:active {
    transform: none !important;
}

/* User Dropdown - Plain Text Only */
.user-dropdown {
    position: relative;
}

.user-dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: opacity 0.2s ease;
    font-size: 0.9rem;
    color: var(--text-primary, #333);
}

.user-dropdown-toggle:hover {
    opacity: 0.8;
    background: none !important;
    transform: none !important;
}

.user-email {
    font-weight: 400;
    white-space: nowrap;
    text-transform: lowercase;
    font-family: inherit;
}

.user-dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.2s ease;
}

.user-dropdown.active .user-dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--card-bg, #ffffff);
    border: 1px solid var(--border-color, #e0e0e0);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1001;
}

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

.user-dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color, #e0e0e0);
}

.user-dropdown-name {
    font-weight: 600;
    color: var(--text-primary, #333);
    margin-bottom: 4px;
}

.user-dropdown-email {
    font-size: 0.85rem;
    color: var(--text-secondary, #666);
    word-break: break-all;
}

.user-dropdown-items {
    padding: 8px 0;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary, #333);
    text-decoration: none;
    transition: background 0.2s ease;
    cursor: pointer;
}

.user-dropdown-item:hover {
    background: var(--hover-bg, #f5f5f5);
}

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

.user-dropdown-item.danger:hover {
    background: #fff5f5;
}

.user-dropdown-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.user-dropdown-icon svg {
    width: 18px;
    height: 18px;
    color: inherit;
}

/* Dark mode adjustments */
body.dark-mode .top-header {
    background: var(--header-bg, #1a1a1a);
    border-bottom-color: var(--border-color, #333);
}

body.dark-mode .lang-switcher {
    background: var(--bg-secondary, #2a2a2a);
}

body.dark-mode .user-dropdown-menu {
    background: var(--card-bg, #2a2a2a);
    border-color: var(--border-color, #444);
}

/* Responsive */
@media (max-width: 768px) {
    .header-title {
        font-size: 1.1rem;
    }

    .lang-switcher {
        display: none;
    }
}
