/* Shared Header Styles - Desktop Focused */
/* Mobile styles are in mobile_responsive_redesign.css */

:root {
    --primary: #1e40af;
    --secondary: #f59e0b;
    --accent: #10b981;
    --dark: #1f2937;
    --light: #f8fafc;
    --gray: #6b7280;
}

/* Header - Hamburger-first (compact bar: logo + search + menu) */
.header {
    --header-height: 72px; /* Used by search_optimized for fixed bar positioning */
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 0.6rem 0;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.header-content {
    position: relative;
    z-index: 2;
    text-align: left;
    color: white;
    display: grid !important;
    grid-template-columns: 1fr auto 1fr !important;
    align-items: center;
    padding: 0 10px;
    gap: 16px !important;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}
.header-content > a:first-of-type {
    justify-self: start;
}
.header-content > .mobile-menu-toggle,
.header-content > #mobileMenuToggleBtn {
    justify-self: end;
}

.logo-small {
    height: 52px;
    width: auto;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo-small:hover {
    transform: scale(1.05);
}

/* Search Container - page-centered (middle column), larger */
.header .search-container,
body .header .search-container,
.header-content .search-container,
body .header-content .search-container {
    width: 100% !important;
    max-width: 520px !important;
    min-width: 200px !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    justify-self: center !important;
    grid-column: 2 !important;
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    box-shadow: none !important;
    height: auto !important;
}

@media (max-width: 992px) {
    .header .search-container,
    body .header .search-container,
    .header-content .search-container,
    body .header-content .search-container {
        max-width: 380px !important;
    }
}

/* Search Box - larger, full width of container */
.search-box,
.header .search-box,
body .header .search-box,
.header-content .search-box,
body .header-content .search-box {
    background: #ffffff !important;
    background-color: #ffffff !important;
    -webkit-background-color: #ffffff !important;
    -moz-background-color: #ffffff !important;
    border-radius: 10px !important;
    padding: 0 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    align-items: stretch !important;
    width: 100% !important;
    height: 56px !important;
    overflow: hidden !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    transition: box-shadow 0.3s ease !important;
    box-sizing: border-box !important;
    margin: 0 !important;
}

.search-box:focus-within {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

.search-input {
    flex: 1;
    border: none;
    padding: 0 18px;
    font-size: 0.95rem;
    background: transparent;
    outline: none;
    color: #1f2937;
    font-family: 'Inter', sans-serif;
}

.search-input::placeholder {
    color: #9ca3af;
}

.search-btn {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 24px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.search-btn:hover {
    background: #1e3a8a;
}

.search-btn:active {
    background: #1e3a8a;
    transform: scale(0.98);
}

.search-btn i {
    font-size: 1rem;
}

/* Hamburger menu toggle - always visible (hamburger-first header) */
.mobile-menu-toggle,
#mobileMenuToggleBtn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    pointer-events: auto;
}
.mobile-menu-toggle:hover,
#mobileMenuToggleBtn:hover {
    background: rgba(255, 255, 255, 0.35);
}

/* Slide-out menu (hidden until .active) */
.mobile-menu {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 280px;
    max-width: 90vw;
    height: 100vh;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    box-shadow: -4px 0 20px rgba(0,0,0,0.2);
    z-index: 1001;
    flex-direction: column;
    padding: 4rem 0 1rem;
    overflow-y: auto;
}
.mobile-menu.active {
    display: flex !important;
}
.mobile-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.25rem;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    font-size: 0.95rem;
}
.mobile-menu a:hover {
    background: rgba(255,255,255,0.15);
}
.mobile-menu a i {
    font-size: 1.2rem;
    width: 24px;
}

/* Desktop nav hidden - all navigation in hamburger menu */
.header-nav {
    display: none !important;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px !important;
    padding-left: 20px !important;
    min-width: fit-content !important;
    flex-shrink: 0 !important;
    max-width: none !important;
}

.nav-buttons {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    flex-wrap: nowrap;
}

.nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px !important;
    height: 45px !important;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.3);
    font-size: 0.9rem !important;
    position: relative;
    margin: 0 7px !important;
}

.nav-btn::before {
    content: attr(data-label);
    position: absolute;
    top: -23px !important;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.65rem !important;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.3s ease;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 5px !important;
    border-radius: 4px;
    pointer-events: none;
    z-index: 1000;
}

.nav-btn:hover::before {
    opacity: 1;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.nav-btn.logout-btn {
    background: rgba(220, 53, 69, 0.8);
    border-color: rgba(220, 53, 69, 0.9);
}

.nav-btn.logout-btn:hover {
    background: rgba(220, 53, 69, 1);
}

.nav-btn.login-btn,
.nav-btn.register-btn {
    width: auto;
    padding: 7px 14px !important;
    border-radius: 18px !important;
    font-size: 0.85rem !important;
    font-weight: 500;
}

.nav-btn.login-btn {
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.register-btn {
    background: var(--primary);
    border-color: var(--primary);
}

.nav-btn.register-btn:hover {
    background: #1e3a8a;
    border-color: #1e3a8a;
}

/* Navigation Badges */
.nav-badge {
    position: absolute;
    top: -7px !important;
    right: -7px !important;
    min-width: 16px !important;
    height: 16px !important;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 50%;
    font-size: 0.6rem !important;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    animation: pulse 2s infinite;
}

.vault-badge {
    background: linear-gradient(135deg, #10b981, #059669);
    animation: pulse-green 2s infinite;
}

.watchlist-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    animation: pulse-orange 2s infinite;
}

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

@keyframes pulse-green {
    0% { transform: scale(1); box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 4px 12px rgba(16, 185, 129, 0.5); }
    100% { transform: scale(1); box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3); }
}

@keyframes pulse-orange {
    0% { transform: scale(1); box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3); }
    50% { transform: scale(1.1); box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5); }
    100% { transform: scale(1); box-shadow: 0 2px 6px rgba(245, 158, 11, 0.3); }
}

.nav-btn:hover .nav-badge {
    transform: scale(1.2);
    animation: none;
}

/* Disabled Navigation Buttons */
.disabled-nav-btn {
    opacity: 0.4;
    cursor: not-allowed;
}

.disabled-nav-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: none;
    box-shadow: none;
}

/* Mobile Nav Badges */
.mobile-nav-btn .nav-badge {
    position: static;
    margin-left: auto;
    min-width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.mobile-nav-btn .vault-badge {
    background: linear-gradient(135deg, #10b981, #059669);
}

.mobile-nav-btn .watchlist-badge {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

/* Force hamburger visible on every page that uses shared header (all viewports, except index) */
html body .header .header-content .mobile-menu-toggle,
html body .header .header-content #mobileMenuToggleBtn {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Import Mobile Responsive Redesign - Must load after this file */
/* Note: For better mobile browser compatibility, also include as direct <link> tag */
@import url('mobile_responsive_redesign.css?v=2.0');
