/*
Theme Name: CLUBapp
Author: WPcoderGem & Partner
Version: 1.0.1
Description: Custom built partner theme.
*/

/* =========================================
   1. RESET & BASE
   ========================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Header specifika variabler */
    --header-h-mobile: 100px;
    --header-bg: var(--primary-color);
    --header-text: #FFFFFF;
}

body {
    background-color: var(--app-bg-color); /* Styrs av customizer */
    color: #1a1a1a;
    font-family: var(--font-body); /* Styrs av customizer */
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* =========================================
   2. TYPOGRAPHY
   ========================================= */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-headline); /* Styrs av customizer */
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--primary-color);
    text-transform: uppercase; 
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

/* =========================================
   3. LAYOUT UTILITIES
   ========================================= */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal !important;
}

/* =========================================
   4. BUTTONS
   ========================================= */
.btn {
    display: inline-block;
    padding: 12px 20px;
    text-align: center;
    border-radius: 4px;
    font-weight: 700;
    font-family: var(--font-headline);
    font-size: 0.9rem;
    cursor: pointer;
    line-height: 1;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #fff;
    border: 2px solid var(--primary-color);
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid #ddd;
    color: #333;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}
/* =========================================
   5. HEADER STRUCTURE & DESIGN
   ========================================= */
.site-header {
    background-color: var(--header-bg);
    color: var(--header-text);
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header-container {
    height: 100%;
    position: relative;
}

/* --- User Toggle Button --- */
.user-toggle-btn {
    background: none;
    border: none;
    color: var(--header-text);
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0;
}

.user-icon {
    width: 24px;
    height: 24px;
    margin-right: 8px;
    filter: brightness(0) invert(1);
}

.arrow-icon {
    width: 14px;
    height: auto;
    margin-left: 8px;
    filter: brightness(0) invert(1);
    transition: transform 0.3s ease;
}

.user-toggle-btn.is-open .arrow-icon {
    transform: rotate(180deg);
}

/* --- Login Dropdown --- */
.login-dropdown-area {
    display: none;
    background: #FFF;
    color: #333;
    z-index: 1001;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.login-dropdown-area.is-open {
    display: block;
    animation: fadeSlideIn 0.2s ease-out;
}

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

.login-title {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #1a1a1a;
}

.login-desc {
    font-size: 0.95rem;
    margin-bottom: 20px;
    color: #555;
}

.login-actions {
    display: flex;
    gap: 10px;
}

.login-actions .btn {
    flex: 1;
}

/* =========================================
   6. RESPONSIVE HEADER LOGIC
   ========================================= */

/* --- MOBILE & TABLET (< 992px) --- */
@media (max-width: 991px) {
    .site-header {
        position: fixed;
        top: 0;
        left: 0;
        height: var(--header-h-mobile);
    }

    body {
        padding-top: var(--header-h-mobile);
    }

    .header-desktop-view {
        display: none;
    }

    /* Mobil layout-fix */
    .header-mobile-view {
        display: flex;
        align-items: center;
        justify-content: center; /* Centrerar logotypen */
        height: 100%;
        position: relative;
    }

    .site-branding {
        z-index: 1;
    }

    .custom-logo {
        height: 80px; /* ÖKAD STORLEK (tidigare 60px) */
        width: auto;
        transition: height 0.3s ease;
    }

    /* Logga in knappen - Fixad positionering */
    .header-mobile-view .header-user-toggle {
        position: absolute;
        right: 0;
        bottom: 5px; /* Ligger nu i botten (med lite marginal för snygghet) */
        top: auto;   /* Tar bort centreringen */
        transform: none;
        z-index: 2;
    }
    
    /* Dropdown under header */
    .login-dropdown-area {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        padding: 20px;
        border-top: 1px solid #eee;
    }
}

/* --- DESKTOP (>= 992px) --- */
@media (min-width: 992px) {
    body {
        padding-top: 0;
    }

    .site-header {
        position: relative;
        padding: 20px 0;
    }

    .header-mobile-view {
        display: none;
    }

    .header-desktop-view {
        display: block;
    }

    /* Logo Section */
    .header-top-row {
        display: flex;
        justify-content: center;
        margin-bottom: 10px;
    }

    .custom-logo {
        height: 120px; /* Stor logo desktop */
        width: auto;
        transition: height 0.3s ease;
    }

    /* Navigation & User Section */
    .header-bottom-row {
        display: flex;
        justify-content: center;
        align-items: flex-end; /* Innehållet linjerar i botten */
        position: relative;
        border-top: 1px solid rgba(255,255,255,0.15);
        padding-top: 15px;
        min-height: 40px;
    }

    .main-navigation ul {
        list-style: none;
        display: flex;
        gap: 35px;
        margin: 0;
        padding: 0;
    }

    .main-navigation a {
        color: #fff;
        font-family: var(--font-headline);
        font-size: 1.1rem;
        text-transform: uppercase;
        font-weight: 500;
        display: block;
        line-height: 1;
    }

    .main-navigation a:hover {
        color: var(--accent-color);
    }

    /* User Toggle Positionering - Desktop */
    .header-desktop-view .header-user-toggle {
        position: absolute;
        right: 0;
        bottom: 0; /* Låst till bottenlinjen */
        transform: none;
        padding-bottom: 0;
    }
    
    .header-desktop-view .arrow-icon {
        margin-bottom: 2px;
    }

    /* Dropdown Logic Desktop */
    .login-dropdown-area {
        position: absolute;
        top: 100%;
        right: 0;
        width: 300px;
        padding: 30px;
        border-radius: 0 0 4px 4px;
        margin-top: 20px;
    }

    .login-dropdown-area::before {
        content: '';
        position: absolute;
        top: -8px;
        right: 20px;
        border-left: 8px solid transparent;
        border-right: 8px solid transparent;
        border-bottom: 8px solid #FFF;
    }
}