/* ========================================================================
   NordicWeather - layout.css
   Layout-komponenter, struktur och grid
   ======================================================================== */

/* ========================================================================
   LAYOUT-KOMPONENTER (HEADER, MAIN, FOOTER)
   ======================================================================== */

/* Header - Uppdaterad f�r att inkludera s�kruta */
.site-header {
    background-color: var(--background-white);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    padding: 3rem 0 !important; /* EXTREMT �kad f�r desktop */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    padding: 0;
    align-items: center;
}

    .navbar .container {
        display: flex;
        align-items: center;
        justify-content: space-between;
        position: relative;
        width: 100%;
    }

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg viewBox='0 0 30 30' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath stroke='blue' stroke-width='2' stroke-linecap='round' stroke-miterlimit='10' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E") !important;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    padding: 0;
    flex-shrink: 0;
}

.brand-nordic {
    color: var(--primary-color);
}

.brand-weather {
    color: var(--dark-text);
}

/* Animerade bokstäver i brand */
.navbar-brand .char,
.footer-brand .char {
    display: inline-block;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    cursor: pointer;
}

.navbar-brand .char:hover,
.footer-brand .char:hover {
    transform: translateY(-8px);
}

.navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.nav-link {
    color: var(--dark-text);
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: var(--transition-standard);
}

    .nav-link:hover,
    .nav-link:focus {
        color: var(--primary-color);
    }

/* ========================================================================
   HEADER SEARCH CONTAINER - FIXAD CENTRERING
   ======================================================================== */

/* DESKTOP VERSION - Fixad absolut centrering */
.header-search-container {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 50%; /* Procentbaserad bredd som anpassar sig till skärmen */
    max-width: 700px; /* Max på stora skärmar */
    min-width: 280px; /* Min för att inte bli för smal */
    z-index: 100;
}

.header-search-input-container {
    position: relative;
    width: 100%;
}

.header-search-input {
    width: 100%;
    height: 44px;
    padding: 0.75rem 1rem 0.75rem 2.75rem;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: var(--input-radius);
    background-color: var(--background-light);
    font-size: 0.95rem;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

    .header-search-input:focus {
        outline: none;
        border-color: var(--primary-color);
        background-color: white;
        box-shadow: 0 0 0 3px rgba(30, 136, 229, 0.15);
    }

    .header-search-input::placeholder {
        color: var(--medium-text);
    }

.header-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    pointer-events: none;
    z-index: 10;
}

/* ========================================================================
   RESPONSIVA JUSTERINGAR F�R HEADER SEARCH - FULLST�NDIGT OMGJORDA
   ======================================================================== */

/* Problematisk mellanstorlek - där allt krockar */
@media (max-width: 1199px) and (min-width: 768px) {
    .header-search-container {
        width: 28%; /* Mycket mindre */
        max-width: 320px;
        min-width: 240px;
        left: 52%; /* Flytta lite åt höger från center */
    }

    .header-search-input {
        font-size: 0.8rem;
        padding-left: 2.2rem;
        height: 38px;
    }

    .header-search-icon {
        width: 14px;
        height: 14px;
        left: 0.6rem;
    }

    /* Minska brand-storleken lite */
    .navbar-brand {
        font-size: 1.25rem;
    }

    /* Ge navbar-nav mer margin för att inte gå in i sökrutan */
    .navbar-nav {
        margin-right: 0.5rem;
    }

    .nav-menu-button {
        width: 38px;
        height: 38px;
        padding: 0.35rem;
    }

    .nav-menu-button svg {
        width: 17px;
        height: 17px;
    }
}

/* Extra problematisk zon - 768px till 900px */
@media (max-width: 900px) and (min-width: 768px) {
    .header-search-container {
        width: 26%;
        max-width: 280px;
        left: 53%; /* Ännu mer åt höger */
    }

    .header-search-input {
        font-size: 0.75rem;
        height: 36px;
        padding-left: 2rem;
    }

    .navbar-brand {
        font-size: 1.2rem;
    }
}

/* MOBIL VERSION - Fullst�ndigt omgjord */
@media (max-width: 767.98px) {
    .site-header {
        padding: 1.5rem 0 !important;
    }

    /* Mobilnavigation - Brand och Meny p� samma rad */
    .navbar .container {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    /* F�rsta raden: Brand v�nster, Meny h�ger */
    .mobile-top-row {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        order: 1;
    }

    .navbar-brand {
        font-size: 1.3rem !important;
        margin: 0 !important;
        order: 1;
    }

    .navbar-nav {
        margin: 0 !important;
        order: 2;
    }

    /* Andra raden: Centrerad s�kruta */
    .header-search-container {
        position: static !important;
        transform: none !important;
        left: auto !important;
        top: auto !important;
        width: 100% !important;
        max-width: 500px !important;
        margin: 0 auto !important;
        order: 2;
    }

    .header-search-input {
        height: 44px !important;
        font-size: 0.95rem !important;
        padding-left: 2.5rem !important;
        width: 100% !important;
    }

    .header-search-icon {
        left: 0.85rem !important;
        width: 16px !important;
        height: 16px !important;
    }
}

/* Extra sm� sk�rmar */
@media (max-width: 575.98px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .header-search-container {
        max-width: 400px !important;
    }

    .header-search-input {
        height: 40px;
        font-size: 0.85rem;
        padding-left: 2rem;
    }

    .header-search-icon {
        left: 0.5rem;
        width: 14px;
        height: 14px;
    }
}

/* ========================================================================
   AUTOCOMPLETE DROPDOWN - FIXAD POSITIONERING
   ======================================================================== */

.ui-autocomplete {
    z-index: 99999 !important;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    border-radius: var(--card-radius);
    box-shadow: 0 12px 32px rgba(13, 71, 161, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
    margin-top: 5px !important;
    position: absolute !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Dropdown menu styling - PROFESSIONELL VERSION */
.dropdown-menu {
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(13, 71, 161, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem;
    margin-top: 0.75rem;
    min-width: 240px;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
    animation: slideDown 0.2s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-item {
    padding: 0.875rem 1.25rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    color: #ffffff;
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

    .dropdown-item::before {
        content: '';
        position: absolute;
        left: 0;
        top: 0;
        bottom: 0;
        width: 3px;
        background: rgba(255, 255, 255, 0.5);
        transform: scaleY(0);
        transition: transform 0.2s ease;
    }

    .dropdown-item:hover::before,
    .dropdown-item:focus::before {
        transform: scaleY(1);
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        padding-left: 1.5rem;
    }

    .dropdown-item:active {
        background: rgba(255, 255, 255, 0.25);
    }

.dropdown-divider {
    margin: 0.75rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========================================================================
   HERO-SEKTION - BEH�LLS OF�R�NDRAD
   ======================================================================== */

.hero-section {
    background: var(--primary-gradient);
    color: white;
    padding: 4rem 0;
    margin-bottom: 2rem;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--box-shadow);
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    font-weight: 400;
    opacity: 0.95;
    color: white;
}

.hero-search {
    max-width: 600px;
    margin: 0 auto 2rem;
}

    .hero-search .form-control {
        height: 56px;
        border-radius: 28px;
        padding-left: 1.5rem;
        border: none;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
        font-size: 1.1rem;
    }

    .hero-search .search-button {
        border-radius: 0 28px 28px 0;
        background-color: var(--accent-color);
        border-color: var(--accent-color);
        padding: 0 1.5rem;
        font-weight: 600;
    }

        .hero-search .search-button:hover {
            background-color: var(--accent-dark);
            border-color: var(--accent-dark);
            transform: translateY(-1px);
        }

.popular-cities {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.popular-label {
    font-size: 1rem;
    font-weight: 500;
    color: white;
    opacity: 0.95;
}

.city-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}

.city-chip {
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.4rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition-standard);
    backdrop-filter: blur(4px);
}

    .city-chip:hover {
        background-color: rgba(255, 255, 255, 0.3);
        color: white;
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

/* Container f�r v�dersidan */
.weather-container {
    max-width: 1200px;
    margin: 0 auto;
}

/* V�der�versikt header */
.location-header {
    margin-bottom: 2rem;
    text-align: center;
}

.location-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-dark);
    margin-bottom: 0.5rem;
    text-align: center;
    letter-spacing: -0.02em;
    position: relative;
    display: inline-block;
}

    .location-title::after {
        content: '';
        position: absolute;
        width: 40%;
        height: 4px;
        background: var(--primary-gradient);
        bottom: -8px;
        left: 30%;
        border-radius: 4px;
    }

.location-date {
    font-size: 1rem;
    color: var(--medium-text);
    font-weight: 500;
}

/* Main content */
.site-main {
    flex: 1 0 auto;
    padding: 2rem 0;
}

/* Footer */
.site-footer {
    background-color: var(--dark-text);
    color: var(--background-white);
    padding: 3rem 0;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.footer-brand {
    margin-bottom: 1rem;
}

.footer-tagline {
    font-size: 0.875rem;
    margin-top: 0.5rem;
    color: var(--light-text);
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

    .footer-links a {
        color: var(--background-white);
    }

        .footer-links a:hover {
            color: var(--primary-light);
        }

.footer-copyright {
    width: 100%;
    margin-top: 2rem;
    font-size: 0.875rem;
    color: var(--light-text);
}
/* ========================================================================
   DROPDOWN MENU Z-INDEX FIX - L�gg till i layout.css eller responsive.css
   ======================================================================== */

/* DROPDOWN MENU - H�GRE Z-INDEX �N S�KRUTAN */
.dropdown-menu {
    z-index: 10000 !important; /* H�gre �n s�krutans z-index */
    border-radius: 12px !important;
    box-shadow: 0 12px 32px rgba(13, 71, 161, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    border: 2px solid rgba(255, 255, 255, 0.2) !important;
    padding: 0.75rem !important;
    margin-top: 0.75rem !important;
    min-width: 240px !important;
    background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
    animation: slideDown 0.2s ease-out !important;
}

/* NAVBAR DROPDOWN CONTAINER - S�KERST�LL R�TT STACKING */
.navbar-nav .dropdown {
    position: relative;
    z-index: 10000 !important;
}

.nav-item.dropdown {
    z-index: 10000 !important;
}

/* DROPDOWN TOGGLE BUTTON */
.dropdown-toggle {
    z-index: 10001 !important;
}

/* MOBILSPECIFIKA JUSTERINGAR */
@media (max-width: 767.98px) {
    /* S�kerst�ll att dropdown visas �ver s�krutan */
    .navbar-nav {
        z-index: 10000 !important;
        position: relative !important;
    }

    .dropdown-menu {
        z-index: 10001 !important;
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        min-width: 220px !important;
        margin-top: 0.5rem !important;
        box-shadow: 0 12px 32px rgba(13, 71, 161, 0.25), 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        background: linear-gradient(135deg, #1565c0 0%, #0d47a1 100%) !important;
        border: 2px solid rgba(255, 255, 255, 0.2) !important;
        border-radius: 12px !important;
    }

    /* Mobilanpassad meny-knapp */
    .nav-menu-button {
        width: 40px;
        height: 40px;
        padding: 0.4rem;
    }

        .nav-menu-button svg {
            width: 20px;
            height: 20px;
        }

    /* S�krutan ska ha l�gre z-index �n dropdown */
    .header-search-container {
        z-index: 100 !important; /* L�gre �n dropdown */
    }

    .header-search-input {
        z-index: 101 !important;
    }

    /* Autocomplete ska ha z-index mellan s�kruta och dropdown */
    .ui-autocomplete {
        z-index: 5000 !important; /* H�gre �n s�kruta men l�gre �n dropdown */
    }
}

/* DESKTOP - S�kerst�ll att dropdown fungerar */
@media (min-width: 768px) {
    .dropdown-menu {
        z-index: 10000 !important;
        min-width: 240px !important;
    }

    /* Header search har l�gre z-index */
    .header-search-container {
        z-index: 100 !important;
    }
}

/* DROPDOWN ITEMS STYLING */
.dropdown-item {
    padding: 0.875rem 1.25rem !important;
    border-radius: 8px !important;
    transition: all 0.2s ease !important;
    color: #ffffff !important;
    font-weight: 500 !important;
    font-size: 0.95rem !important;
    position: relative !important;
    overflow: hidden !important;
    background-color: transparent !important;
}

    .dropdown-item::before {
        content: '' !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        bottom: 0 !important;
        width: 3px !important;
        background: rgba(255, 255, 255, 0.5) !important;
        transform: scaleY(0) !important;
        transition: transform 0.2s ease !important;
    }

    .dropdown-item:hover::before,
    .dropdown-item:focus::before {
        transform: scaleY(1) !important;
    }

    .dropdown-item:hover,
    .dropdown-item:focus {
        background: rgba(255, 255, 255, 0.2) !important;
        color: #ffffff !important;
        padding-left: 1.5rem !important;
    }

    .dropdown-item:active {
        background: rgba(255, 255, 255, 0.25) !important;
    }

.dropdown-divider {
    margin: 0.75rem 0 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* S�KERST�LL ATT MENY-KNAPPEN ALLTID �R KLICKBAR */
.nav-link.dropdown-toggle {
    position: relative;
    z-index: 10002 !important;
    background-color: transparent !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
}

/* PROFESSIONELL MENY-KNAPP */
.nav-menu-button {
    position: relative;
    z-index: 10002 !important;
    background-color: transparent;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

    .nav-menu-button svg {
        color: #374151;
        transition: color 0.2s ease;
    }

    .nav-menu-button:hover {
        background-color: #f9fafb;
        border-color: #d1d5db;
    }

        .nav-menu-button:hover svg {
            color: #1e40af;
        }

    .nav-menu-button:focus {
        outline: none;
        border-color: #1e40af;
        box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    }

    .nav-menu-button[aria-expanded="true"] {
        background-color: #f3f4f6;
        border-color: #1e40af;
    }

        .nav-menu-button[aria-expanded="true"] svg {
            color: #1e40af;
        }

/* Fixa hero-s�krutans bredd problem */
.hero-search {
    max-width: 600px !important; /* F�rst�rk med !important */
    margin: 0 auto 2rem !important;
}

    .hero-search .search-container {
        max-width: 100% !important;
        width: 100% !important;
    }

/* Specifikt f�r desktop input-f�ltet */
#locationDesktop {
    max-width: 500px !important;
    width: 100% !important;
}

/* F�r mobil input-f�ltet ocks� */
#location {
    max-width: 100% !important;
    width: 100% !important;
}

/* S�kerst�ll att form-control f�ljer containerns bredd */
.hero-search .form-control {
    max-width: 100% !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Autocomplete ska inte vara bredare �n input */
.ui-autocomplete {
    max-width: 500px !important;
    box-sizing: border-box !important;
}

/* Responsiva justeringar */
@media (max-width: 768px) {
    .hero-search {
        max-width: 100% !important;
        padding: 0 15px !important;
    }

    #locationDesktop,
    #location {
        max-width: 100% !important;
    }

    .ui-autocomplete {
        max-width: calc(100vw - 30px) !important;
    }
}

/* F�r st�rre sk�rmar */
@media (min-width: 1200px) {
    .hero-search {
        max-width: 700px !important;
    }

    #locationDesktop {
        max-width: 600px !important;
    }

    .ui-autocomplete {
        max-width: 600px !important;
    }
}