:root {
    --accent: #4DB849;
    --text-light: #ffffff;
    --text-dim: rgba(255, 255, 255, 0.7);
    --font-stack: "Inter", system-ui, -apple-system, sans-serif;
}

body { margin: 0; background: #000; }

/* ---------------------------------------------------------
   BASE
--------------------------------------------------------- */
#fab-wrapper {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    overflow: hidden;
    background: #000;
    font-family: var(--font-stack);
    color: var(--text-light);
    line-height: normal;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

a { text-decoration: none; color: inherit; }
button { border: none; background: none; cursor: pointer; font-family: inherit; color: inherit; }

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 4px;
}

/* ---------------------------------------------------------
   BACKGROUND
--------------------------------------------------------- */
.bg-container {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.bg-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out;
}

/* Zatamnjenje pozadine preko overlaya (jeftinije od filter: brightness na cijelom ekranu) */
.bg-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
}

.bg-slide.active {
    opacity: 1;
    animation: fab-paneffect 20s infinite alternate;
    will-change: transform;
}

@keyframes fab-paneffect {
    from { transform: scale(1); }
    to   { transform: scale(1.1); }
}

/* ---------------------------------------------------------
   UI OVERLAY + HEADER
--------------------------------------------------------- */
.ui-overlay {
    position: relative;
    z-index: 10;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 2rem 4rem;
    background: linear-gradient(to right, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.1) 60%);
}

/* Lijevo: logotipi, desno: jezici */
.header {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
    min-height: 80px;
    flex-shrink: 0;
}

/* Par logotipa uz lijevu marginu, jednaka vizualna težina */
.brands {
    justify-self: start;
    display: flex;
    align-items: center;
    gap: 2.25rem;
}

.brands-sep {
    width: 1px;
    height: 44px;
    background: rgba(255, 255, 255, 0.3);
}

.partner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.7rem;
}

.partner-logo {
    display: block;
    height: 36px;
    width: auto;
}

.partner-caption {
    font-size: 0.64rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    white-space: nowrap;
    color: rgba(255, 255, 255, 0.92);
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6);
}

.logo { display: inline-block; }

.logo img {
    display: block;
    height: 60px;
    width: auto;
    transition: transform 0.3s ease;
}

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

.nav-right { justify-self: end; display: flex; align-items: center; }

.lang-switcher {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: uppercase;
}

.lang-btn {
    position: relative;
    padding: 0.5rem 0;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.lang-btn:hover,
.lang-btn[aria-pressed="true"] { opacity: 1; }

.lang-btn[aria-pressed="true"]::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent);
}

/* ---------------------------------------------------------
   HERO CONTENT
--------------------------------------------------------- */
.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    width: 100%;
}

.hero-info {
    width: 40%;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-info.visible { opacity: 1; transform: translateY(0); }

.hero-subtitle {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-height: 2.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.hero-subtitle::before {
    content: '';
    width: 40px;
    height: 2px;
    background: var(--accent);
}

.hero-title {
    min-height: 0.9em;
    margin-bottom: 1rem;
    font-size: 5rem;
    font-weight: 700;
    line-height: 0.9;
    text-transform: uppercase;
}

/* Fiksna visina sprječava "skakanje" teksta pri promjeni slajda */
.hero-desc {
    max-width: 400px;
    min-height: 7.5rem;
    margin-bottom: 1.5rem;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-dim);
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50px;
    font-weight: 500;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

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

/* ---------------------------------------------------------
   CAROUSEL
--------------------------------------------------------- */
.carousel-wrapper {
    position: absolute;
    bottom: 4rem;
    right: 4rem;
    max-width: 70%;
    padding: 2rem 0;
    display: flex;
    justify-content: flex-end;
    overflow: visible;
    pointer-events: none;
}

.cards-track {
    display: flex;
    gap: 1.5rem;
    pointer-events: auto;
}

.card {
    display: block;
    position: relative;
    flex-shrink: 0;
    width: 260px;
    height: 380px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    user-select: none;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), box-shadow 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card.active {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.5), 0 0 60px rgba(77, 184, 73, 0.25);
    z-index: 2;
}

.card-img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.card:hover .card-img { transform: scale(1.1); }

/* Bez trajnog okvira nakon klika; okvir ostaje samo za tastaturu */
.card:focus { outline: none; }
.card:focus-visible { outline: 2px solid var(--accent); }

.card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 8rem 1.5rem 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.95) 0%, rgba(0,0,0,0.7) 50%, transparent 100%);
}

.card-label {
    margin-bottom: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
    text-transform: uppercase;
}

.card-sub { font-size: 0.8rem; color: var(--text-dim); }

/* ---------------------------------------------------------
   CONTROLS
--------------------------------------------------------- */
.controls {
    position: absolute;
    bottom: 4rem;
    left: 4rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-btn {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    transition: border-color 0.3s, background-color 0.3s;
}

.nav-btn:hover {
    border-color: var(--accent);
    background: rgba(77, 184, 73, 0.1);
}

.slide-counter {
    margin-left: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
}

/* ---------------------------------------------------------
   LAPTOP (1025px – 1750px)
--------------------------------------------------------- */
@media (min-width: 1025px) and (max-width: 1750px) {
    .ui-overlay { padding: 1rem 3rem; }

    /* Tekst uvijek iznad kartica */
    .hero-info { position: relative; z-index: 30; width: 50%; }

    .hero-title { margin-bottom: 0.5rem; font-size: 3rem; }
    .hero-desc  { max-width: 420px; margin-bottom: 1rem; font-size: 0.9rem; }
    .cta-btn    { padding: 0.8rem 1.5rem; font-size: 0.9rem; }

    /* Kartice se skaliraju s ekranom da nikad ne prekriju tekst s lijeve strane */
    .carousel-wrapper { bottom: 1.5rem; right: 2rem; max-width: none; z-index: 20; }
    .cards-track { gap: 1rem; }
    .card { width: clamp(140px, 13.6vw, 220px); height: auto; aspect-ratio: 11 / 16; }
    .card-label { font-size: 1.2rem; }
    .card-overlay { padding: 6rem 1rem 1rem; }
    .controls { bottom: 1.5rem; left: 3rem; }
}

/* ---------------------------------------------------------
   TABLET (do 1024px)
--------------------------------------------------------- */
@media (max-width: 1024px) {
    .ui-overlay { padding: 2rem; background: rgba(0, 0, 0, 0.6); }

    .brands { gap: 1.75rem; }
    .partner-logo { height: 32px; }
    .brands-sep { height: 40px; }

    .main-content { flex-direction: column; justify-content: center; align-items: flex-start; }
    .hero-info { width: 100%; margin-bottom: 1rem; }
    .hero-title { font-size: 3.5rem; }

    /* Kartice u normalnom toku, kontrole ispod njih (nema preklapanja) */
    .carousel-wrapper {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        justify-content: center;
    }
    .cards-track { gap: 1rem; }
    .card { width: 160px; height: 240px; aspect-ratio: auto; }
    .card-label { font-size: 1.2rem; }
    .card-overlay { padding: 6rem 1rem 1rem; }

    .controls {
        position: relative;
        bottom: auto;
        left: auto;
        z-index: 20;
        width: 100%;
        padding-bottom: 2rem;
        justify-content: center;
    }
}

/* ---------------------------------------------------------
   MOBILE (do 768px)
--------------------------------------------------------- */
@media (max-width: 768px) {
    #fab-wrapper {
        height: 100dvh;
        min-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
    }

    /* Pozadina fiksirana za viewport da se ne siječe pri skrolu */
    .bg-container { position: fixed; height: 100dvh; }

    .ui-overlay {
        height: auto;
        min-height: 100dvh;
        padding: 3rem 1.5rem 1.5rem;
        justify-content: flex-start;
        background: linear-gradient(to bottom, rgba(0,0,0,0.9), rgba(0,0,0,0.4));
    }

    /* Redoslijed: par logotipa, jezici */
    .header {
        display: flex;
        flex-direction: column;
        min-height: 0;
        gap: 0.9rem;
        padding-bottom: 0.5rem;
    }

    /* Par logotipa se skalira prema širini ekrana da stane u jedan red */
    .brands { gap: 0.75rem; }
    .logo img { width: 43vw; max-width: 200px; height: auto; }
    .brands-sep { height: 26px; }
    .partner-logo { width: 35vw; max-width: 170px; height: auto; }
    .partner-caption { font-size: 0.54rem; letter-spacing: 1.2px; }
    .nav-right { width: 100%; justify-content: center; }

    .main-content {
        flex: 0 0 auto;
        justify-content: flex-start;
        gap: 1.5rem;
        margin-top: 1rem;
        padding-top: 1rem;
    }

    .hero-info { display: flex; flex-direction: column; align-items: flex-start; }

    .hero-subtitle { min-height: 2rem; margin-bottom: 0.5rem; font-size: 0.9rem; }
    .hero-title { min-height: 0; margin-bottom: 0.5rem; font-size: 2.5rem; }
    .hero-desc { max-width: 100%; min-height: 5rem; margin-bottom: 1rem; font-size: 0.85rem; line-height: 1.3; }
    .cta-btn { padding: 0.8rem 1.5rem; font-size: 0.9rem; }

    .carousel-wrapper {
        position: relative;
        bottom: auto;
        right: auto;
        width: 100%;
        max-width: 100%;
        margin-top: 0;
        padding: 0.5rem 0 1rem;
        flex-shrink: 0;
        justify-content: flex-start;
        overflow-x: auto;
        pointer-events: auto;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
    }

    .cards-track { align-items: center; gap: 1rem; padding: 0 2rem 0 0.5rem; }
    .card { width: 200px; height: 300px; }
    .card-label { font-size: 1.1rem; }
    .card-overlay { padding: 5rem 1rem 1rem; }

    .controls { margin-top: 2rem; }
}

/* ---------------------------------------------------------
   REDUCED MOTION
--------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .bg-slide { animation: none; transition: none; }
    .hero-info { transition: opacity 0.5s; transform: none; }
    .card { transition: none; transform: none; }
}
    