/* --- TEMA-VARIABLER --- */
:root {
    --bg-color: #ffffff;
    --text-color: #1a1a1a;
    --text-muted: #666666;
    --card-bg: #ffffff;
    --nav-bg: rgba(255, 255, 255, 0.98);
    --nav-border: #f0f0f0;
    --footer-bg: #ffffff;
    --overlay-bg: rgba(0, 0, 0, 0.4);
    --modal-shadow: rgba(0, 0, 0, 0.1);
    --close-icon-filter: none;
}

[data-theme="dark"] {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --text-muted: #a0a0a0;
    --card-bg: #1e1e1e;
    --nav-bg: rgba(18, 18, 18, 0.98);
    --nav-border: #2a2a2a;
    --footer-bg: #181818;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --modal-shadow: rgba(0, 0, 0, 0.5);
    --close-icon-filter: invert(1) grayscale(1) brightness(2);
}

/* --- GRUNDLAYOUT --- */
html {
    font-size: 16px;
    position: relative;
    min-height: 100%;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    font-family: "Poppins", sans-serif;
    overflow-x: hidden;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- NAVIGATION --- */
.custom-nav {
    background: var(--nav-bg);
    border-bottom: 1px solid var(--nav-border);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-color);
    display: flex;
    transition: transform 0.2s ease;
}

.theme-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
    padding: 5px;
}

    .theme-btn:hover {
        transform: rotate(20deg);
    }

.nav-menu {
    position: fixed;
    top: 0;
    left: -280px;
    width: 280px;
    height: 100vh;
    background: var(--bg-color);
    z-index: 1001;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 2rem;
    box-shadow: 10px 0 30px var(--modal-shadow);
}

    .nav-menu.active {
        transform: translateX(280px);
    }

.close-menu {
    background: none;
    border: none;
    font-size: 1.8rem;
    position: absolute;
    top: 20px;
    right: 20px;
    cursor: pointer;
    color: var(--text-color);
}

.nav-links {
    list-style: none;
    padding: 0;
    margin-top: 60px;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

    .nav-links li a {
        text-decoration: none;
        color: var(--text-color);
        font-size: 1.1rem;
        font-weight: 500;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: all 0.2s ease;
    }

        .nav-links li a:hover {
            transform: translateY(-5px);
            opacity: 0.7;
        }

.menu-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
    }

.modal-content {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--nav-border) !important;
    box-shadow: 0 10px 40px var(--modal-shadow) !important;
}

.modal-header, .modal-footer {
    border-color: var(--nav-border) !important;
}

.btn-close {
    filter: var(--close-icon-filter);
    opacity: 0.8;
}

    .btn-close:hover {
        opacity: 1;
    }

/* --- HERO & VIDEO BAKGRUND --- */
.hero-section {
    position: relative;
    height: 75vh;
    width: 100%;
    overflow: hidden;
    background-image: url('/images/daniel_hero.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #000; /* Fallback-färg om bilden mot förmodan inte laddar */
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

    .video-background iframe {
        width: 100vw;
        height: 56.25vw;
        min-height: 100vh;
        min-width: 177.77vh;
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        pointer-events: none;
    }

.hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.45);
    color: white;
    padding: 0 10%;
    text-align: center;
}

.hero-quote {
    font-weight: 700;
    font-size: clamp(1.8rem, 5vw, 3.2rem);
    line-height: 1.1;
    margin-bottom: 2rem;
    z-index: 3;
}

.video-control-btn {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 10;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    opacity: 0.5;
    transform: scale(1.5);
    transition: all 0.3s ease;
}

    .video-control-btn:hover {
        opacity: 1;
        transform: scale(1.7);
    }

/* --- LAYOUT GRID --- */
.main-layout-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px 100px 20px;
    align-items: start;
}

.news-slide {
    background-color: var(--card-bg) !important;
    color: var(--text-color) !important;
}

/* --- DESKTOP ANPASSNINGAR --- */
@media (min-width: 992px) {
    .nav-container {
        justify-content: center;
        position: relative;
    }

    .theme-btn {
        position: absolute;
        right: 0;
    }

    .menu-toggle, .close-menu, .menu-overlay {
        display: none !important;
    }

    .nav-menu {
        position: static;
        width: auto;
        height: auto;
        background: none;
        box-shadow: none;
        padding: 0;
        transform: none !important;
    }

    .nav-links {
        flex-direction: row;
        margin-top: 0;
        gap: 2.5rem;
    }
}

/* --- FOOTER --- */
footer.footer {
    background-color: var(--footer-bg) !important;
    color: var(--text-color) !important;
    border-top: 1px solid var(--nav-border) !important;
    transition: all 0.3s ease;
}

.footer-title {
    color: var(--text-color);
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.footer-link {
    display: inline-block;
    white-space: normal;
    max-width: 100%;
    text-decoration: none;
    transition: 0.3s ease-in;
}

.footer .small {
    line-height: 1.6;
}

.footer-link:hover {
    opacity: 1;
    padding-left: 5px;
    color: var(--text-color) !important;
}

.footer-contact-link:hover,
.footer-contact-link:focus {
    opacity: 0.8;
    color: var(--primary-color);
    text-decoration: underline;
}

[data-theme="dark"] .footer small.text-muted {
    color: var(--text-color) !important;
    opacity: 0.8;
}

    [data-theme="dark"] .footer small.text-muted iconify-icon {
        color: var(--text-color);
    }

.privacy-footer-link {
    text-decoration: none;
    color: var(--text-muted) !important;
    font-size: 0.8rem;
    transition: color 0.2s ease;
}

    .privacy-footer-link:hover {
        color: var(--text-color) !important;
    }

footer iconify-icon {
    vertical-align: middle;
    color: inherit;
}

.privacy-footer-link iconify-icon {
    color: inherit;
}

/* --- KARTA --- */
.map-wrapper {
    width: 90%;
    max-width: 900px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    position: relative;
}

/* --- LOGO TRACK --- */
.logo-track-container {
    overflow: hidden;
    padding: 20px 0;
    position: relative;
    white-space: nowrap;
}

    .logo-track-container::before,
    .logo-track-container::after {
        content: "";
        position: absolute;
        top: 0;
        width: 100px;
        height: 100%;
        z-index: 2;
    }

    .logo-track-container::before {
        left: 0;
        background: linear-gradient(to right, var(--bg-color), transparent);
    }

    .logo-track-container::after {
        right: 0;
        background: linear-gradient(to left, var(--bg-color), transparent);
    }

.logo-track {
    display: inline-flex;
    align-items: center;
    gap: 80px;
    animation: scrollLogos 30s linear infinite;
}

.logo-track:hover{
    animation-play-state: paused;
}

    .logo-track img {
        height: 40px;
        width: auto;
        margin: 0 40px;
        filter: grayscale(100%);
        opacity: 0.6;
        transition: 0.3s ease;
    }

        .logo-track img:hover {
            filter: grayscale(0%);
            opacity: 1;
            transform: scale(1.05);
        }

@keyframes scrollLogos {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-50%);
    }
}

@media (prefers-reduced-motion: reduce) {
    .logo-track {
        animation: none;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 30px;
    }
}

.full-width-border {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}

.stop-animations .logo-track {
    animation-play-state: paused !important;
}

/* --- LIGHTBOX --- */
.image-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--overlay-bg);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.lightbox-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
}

.lightbox-content {
    max-width: 100%;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}

#lightBoxCaption {
    color: #ffffff;
    padding-top: 15px;
    font-size: 1.1rem;
    font-weight: 300;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* --- ZOOM & LIGHTBOX --- */
.image-zoom-container {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: inline-block;
    width: 100%;
}

    .image-zoom-container::after {
        content: '\26b2';
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) scale(0);
        font-size: 2rem;
        color: #fff;
        background: rgba(0,0,0,0.6);
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        transition: transform 0.3s ease;
        pointer-events: none;
        z-index: 2;
    }

    .image-zoom-container:hover::after {
        transform: translate(-50%, -50%) scale(1);
    }

.image-lightbox {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.9);
    backdrop-filter: blur(8px);
    cursor: zoom-out;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .image-lightbox.show {
        display: flex;
        opacity: 1;
    }

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 85%;
    max-height: 85%;
    border: 3px solid #fff;
    border-radius: 5px;
    box-shadow: 0 0 30px rgba(0,0,0,0.8);
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.image-lightbox.show .lightbox-content {
    transform: scale(1);
}

/* --- KUNDKARUSELL --- */
.logo-track-container {
    overflow: hidden;
    padding: 30px 0 60px 0; /* Plats för tooltip under */
    position: relative;
    white-space: nowrap;
    background: transparent;
}

    /* MJUK FADE PÅ KANTERNA */
    .logo-track-container::before,
    .logo-track-container::after {
        content: "";
        position: absolute;
        top: 0;
        width: 150px;
        height: 100%;
        z-index: 2;
        pointer-events: none;
    }

    .logo-track-container::before {
        left: 0;
        background: linear-gradient(to right, var(--bg-color), transparent);
    }

    .logo-track-container::after {
        right: 0;
        background: linear-gradient(to left, var(--bg-color), transparent);
    }

.logo-track {
    display: inline-flex;
    align-items: center;
    gap: 80px;
    animation: scrollLogos 35s linear infinite; /* Jämnt flöde */
}


.logo-item {
    position: relative;
    display: flex;
    align-items: center;
}

    .logo-item img {
        height: 35px;
        filter: grayscale(100%);
        opacity: 0.5;
        transition: all 0.3s ease;
    }

    .logo-item:hover img {
        filter: grayscale(0%);
        opacity: 1;
    }

    /* --- TOOLTIP UNDER --- */
    .logo-item::after {
        content: attr(data-tooltip);
        position: absolute;
        bottom: -40px; /* Under loggan */
        left: 50%;
        transform: translateX(-50%) translateY(-5px);
        background: var(--text-color);
        color: var(--bg-color);
        padding: 5px 12px;
        border-radius: 4px;
        font-size: 0.75rem;
        font-weight: 500;
        white-space: nowrap;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 10;
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }

    .logo-item:hover::after {
        opacity: 1;
        visibility: visible;
        transform: translateX(-50%) translateY(0);
    }

@keyframes scrollLogos {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(calc(-50% - 40px));
    }
}

/* Back to Top Styling */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--text-color); 
    color: var(--bg-color); /* Kontrastfärg */
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    z-index: 1000;
    opacity: 0; /* Osynlig från början */
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

    .back-to-top.show {
        opacity: 1;
        visibility: visible;
    }

    .back-to-top:hover {
        transform: translateY(-5px);
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
    }

/* Anpassning för mindre skärmar */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

.cookie-banner-wrapper {
    position: fixed;
    bottom: 10px;
    left: 10px;
    right: 0;
    width: 25%;
    z-index: 99999; /* Extremt högt värde */
    background: var(--card-bg);
    border-top: 1px solid var(--nav-border);
    padding: 1.5rem;

    transform: translateY(110%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.3);
    border-radius: 20px;
}

.cookie-banner-content {
    text-align: center;
}

.cookie-actions {
    display: flex;
    padding: 1em;
    margin-top: 20px;
    gap: 25px;
}

#btnAccept, #btnDecline {
    border-radius: 20px;
    transition: 0.3s ease-out;
    padding: 0.7em 0.8em;
    border: none;
    white-space: nowrap;
}

#btnAccept:hover, #btnDecline:hover {
    background-color: dimgray;
}

    .cookie-banner-wrapper.show {
        transform: translateY(0);
    }