/*
* Filename: header.css
* Directory: /www/css/
* Description: Stiler for header, logo, meny og SØK (Sikker versjon).
*/

.site-header {
    padding: 0 3rem; 
    border-bottom: 1px solid var(--color-menu-separator);
    position: sticky;
    top: 0;
    background-color: #fff;
    z-index: 100; /* Lavere enn panelet */
}

.header-content {
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.header-left-cluster { display: flex; align-items: center; gap: 30px; }
.logo-container a { display: flex; align-items: center; text-decoration: none; }
.logo-container img { height: 40px; width: auto; }

/* --- Navigasjon --- */
.site-navbar { padding: 0; }
.navbar-menu { margin: 0; padding: 0; list-style: none; display: flex; gap: 5px; }
.navbar-menu li { display: block; border: none; }

.navbar-menu li a {
    font-weight: 600; font-size: 0.95rem; color: var(--color-text);
    padding: 0.5rem 1rem; border-radius: 4px; transition: all 0.2s;
}
.navbar-menu li a:hover { background-color: #f5f5f5; color: var(--color-accent); text-decoration: none; }

.nav-disabled {
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-body); font-weight: 500; font-size: 0.9rem;
    text-transform: uppercase; letter-spacing: 1px; color: #bbb; 
    padding: 0.5rem 1.5rem; white-space: nowrap; cursor: not-allowed; user-select: none;
}
.nav-disabled:hover { color: #999; }

/* --- Høyre side --- */
.header-right { display: flex; align-items: center; gap: 1.5rem; }

/* =========================================
   SØKEMOTOR STYLING
   ========================================= */

.search-wrapper-global {
    position: relative; margin-right: 20px; display: flex; align-items: center;
}

.simple-search-bar form {
    display: flex; align-items: center; background: #fff;
    border-radius: 20px; padding: 2px 5px; border: 1px solid #e0e0e0;
    transition: opacity 0.3s;
}

.simple-search-bar.disabled {
    opacity: 0.4; pointer-events: none; filter: grayscale(100%);
}

.simple-input-wrapper { display: flex; align-items: center; position: relative; }

.header-search-input {
    width: 60px; border: none; background: transparent; outline: none;
    font-size: 0.9rem; padding: 0 0 0 10px; opacity: 1;
    transition: width 0.4s ease; color: #555;
}
.header-search-input:focus, .simple-input-wrapper.active .header-search-input {
    width: 200px; color: #000;
}

.header-search-btn {
    background: none; border: none; font-size: 1.1rem; cursor: pointer;
    padding: 5px 8px; color: #555; border-left: 1px solid transparent;
}
.simple-input-wrapper.active .header-search-btn { border-left: 1px solid #eee; }
.header-search-btn:hover { color: #000; }

/* Avansert Bryter */
.adv-search-toggle {
    display: flex; align-items: center; cursor: pointer;
    margin-right: 8px; padding-right: 8px; border-right: 1px solid #eee;
    font-size: 0.75rem; font-weight: 600; color: #666; gap: 5px;
    z-index: 10; /* Sikre at den kan klikkes */
}
.adv-search-toggle input { opacity: 0; width: 0; height: 0; position: absolute; }

.adv-slider {
    width: 26px; height: 14px; background-color: #ccc;
    border-radius: 34px; position: relative; transition: .3s; display: inline-block;
}
.adv-slider:before {
    position: absolute; content: ""; height: 10px; width: 10px;
    left: 2px; bottom: 2px; background-color: white; border-radius: 50%; transition: .3s;
}
input:checked + .adv-slider { background-color: #df7902; }
input:checked + .adv-slider:before { transform: translateX(12px); }

/* Glidende Panel */
.advanced-panel {
    position: fixed; top: 0; left: 0; width: 100%; background: #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    z-index: 9999; /* MÅ VÆRE HØYEST FOR Å VISES OVER ALT */
    
    /* Animasjon */
    transform: translateY(-100%); 
    transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    visibility: hidden;
    border-bottom: 3px solid #df7902;
}

.advanced-panel.open {
    transform: translateY(0); 
    visibility: visible;
}

.advanced-content { max-width: 1000px; margin: 0 auto; padding: 2rem; }
.adv-header { display: flex; justify-content: space-between; margin-bottom: 20px; }
.adv-header h2 { margin: 0; color: #2c3e50; }
.close-btn { background: none; border: none; font-size: 2rem; color: #999; cursor: pointer; }

.big-input { width: 100%; padding: 15px; font-size: 1.2rem; border: 2px solid #e0e0e0; border-radius: 6px; margin-bottom: 20px; }
.advanced-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; }
.filter-group label { display: block; font-weight: bold; margin-bottom: 5px; font-size: 0.9rem; }
.filter-group select, .filter-group input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; }
.advanced-actions { margin-top: 30px; text-align: right; }
.btn-large { padding: 12px 40px; font-size: 1.1rem; }

/* Innlogget Bruker */
.user-profile-container { display: flex; align-items: center; gap: 1rem; }
.user-profile-link { display: flex; align-items: center; gap: 10px; color: var(--color-text); font-weight: 600; }
.nav-avatar { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
.nav-logout-link { font-size: 0.85rem; color: #e74c3c; }