/* =========================================
   1. OSNOVNE BOJE I VARIJABLE
   ========================================= */
:root {
    --beige: #b5ad8a; /* Changed from #BCA48C */
    --caffe-light: #F9F4F0;
    --dark: #1A1A1A;
}

* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Inter', sans-serif; 
}

body, html {
    background-color: var(--caffe-light);
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* =========================================
   2. APP SCREENS (Logika za prijelaze)
   ========================================= */
.app-screen {
    display: none; 
    width: 100%;
    height: 100vh;
    flex-direction: column;
    animation: fadeIn 0.4s ease-in-out;
}

.app-screen.active {
    display: flex; 
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   3. HOME EKRAN (LANDING PAGE)
   ========================================= */
#home-view {
    position: relative;
    justify-content: flex-end; /* Tekst i gumbi na dnu */
    padding: 30px 20px 60px;
    z-index: 1; 
}

.hero-bg {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background-size: cover; background-position: center;
    z-index: 1; 
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.72) 100%);
    z-index: 2; 
}

.home-content {
    text-align: center;
    color: white;
    position: relative;
    z-index: 10;
}

.home-title {
    font-family: 'Playfair Display', serif; font-size: 2.5rem;
    letter-spacing: 5px; margin-bottom: 5px; font-weight: 500;
}

.home-subtitle {
    font-family: 'Playfair Display', serif; font-size: 1.2rem;
    font-weight: 400; font-style: italic; margin-bottom: 20px; opacity: 0.9;
}

.home-desc {
    font-size: 0.95rem; font-weight: 300; opacity: 0.8; margin-bottom: 40px;
    line-height: 1.6; padding: 0 10px;
}

.home-buttons {
    display: flex; flex-direction: column; gap: 15px;
}

.btn-primary, .btn-secondary {
    width: 100%; padding: 20px; border-radius: 8px;
    font-size: 0.9rem; font-weight: 700; letter-spacing: 1.5px;
    text-transform: uppercase; cursor: pointer; transition: 0.3s;
    border: none;
}

.btn-primary {
    background-color: var(--beige); color: white;
    box-shadow: 0 4px 15px rgba(188, 164, 140, 0.5);
}

.btn-secondary {
    background-color: transparent; color: white;
    border: 1.5px solid rgba(255,255,255,0.6);
}

/* =========================================
   4. BIRAČ JEZIKA (HOME EKRAN)
   ========================================= */
.home-lang-position {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000; 
}

/* Premium okvir za jezik s globusom */
.lang-wrapper {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(8px);
    border: 1px solid var(--beige);
    border-radius: 25px; /* Malo zaobljenije */
    padding: 8px 16px; /* Malo veći box */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.globe-icon-inner {
    width: 16px; /* Malo veća ikonica */
    height: 16px;
    margin-right: 8px;
}

#home-lang-switch {
    border: none;
    background: transparent;
    font-size: 12px;
    font-weight: 800;
    color: var(--beige);
    outline: none;
    cursor: pointer;
    text-transform: uppercase;
    appearance: none; /* Miče defaultnu ružnu strelicu */
    
    /* DODAJEMO STRELICU */
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23BCA48C'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0 center;
    background-size: 16px;
    padding-right: 22px; /* Prostor za strelicu */
}


/* =========================================
   5. HEADER NA MAPI I FAQ EKRANU
   ========================================= */
.app-header {
    background-color: var(--caffe-light);
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
}

.header-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px 10px;
}

.nav-back-btn, .nav-home-btn {
    background: none; border: none; font-size: 24px;
    color: var(--dark); cursor: pointer; padding: 5px;
}

.main-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.35rem; 
    color: var(--dark);
    margin: 0;
    text-align: center;
    flex-grow: 1; 
}

/* =========================================
   6. INTERAKTIVNA KARTA
   ========================================= */
.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 18px 20px;
    border-top: 1px solid rgba(0,0,0,0.1);
    cursor: pointer;
}

.label-filter-by {
    font-size: 0.75rem;
    letter-spacing: 0.8px;
    font-weight: 700;
    color: var(--dark);
}

.header-icon-filter {
    width: 20px; height: 20px;
}

#map {
    flex-grow: 1;
    width: 100%;
    background: #e5e3df;
}

/* =========================================
   7. PINOVI NA MAPI
   ========================================= */
/* Osnovna kapljica (Beige) */
.custom-pin {
    width: 42px; 
    height: 42px;
    background: var(--beige); /* Boja kave */
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    display: flex; 
    align-items: center; 
    justify-content: center;
    border: 2px solid white;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    /* Gledaj kako se glatko mijenja boja i veličina */
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: auto !important; /* BITNO */
    cursor: pointer;
}


/* Kad pin dobije klasu .active, postaje plav i veći */
.custom-pin.active {
    background-color: hwb(239 58% 6%) !important; 
    transform: rotate(-45deg) scale(1.3) !important; 
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.4) !important;
    z-index: 9999 !important;
}

.custom-pin-wrapper {
    position: relative;
    z-index: 999999;
}


/* Ikonica unutar pina - ostaje bijela */
.pin-png-icon {
    width: 24px; 
    height: 24px;
    pointer-events: none; /* Ovo je KLJUČNO! Omogućuje kliku da prođe do pina */
    transform: rotate(45deg);
    filter: brightness(0) invert(1);
}

/* =========================================
   8. FILTER MODAL
   ========================================= */
.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    display: none; align-items: flex-end; z-index: 2000;
}

.modal-overlay.open { display: flex; }

.modal-content {
    background: var(--caffe-light);
    width: 100%;
    border-radius: 30px 30px 0 0;
    padding: 35px 25px 25px;
    position: relative;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.1);
}

.close-modal {
    position: absolute; top: 15px; right: 20px;
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: #f0f0f0; font-size: 22px; cursor: pointer;
}

.modal-content h2 {
    font-family: 'Playfair Display', serif;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 30px;
}

#category-list {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 5px;
}

.cat-row {
    display: flex; align-items: center;
    padding: 16px 10px; 
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-radius: 10px; 
}

.cat-row:active {
    background-color: rgba(188, 164, 140, 0.1); 
}

.cat-row-icon {
    width: 30px; height: 30px;
    margin-right: 15px;
    filter: sepia(1) brightness(0.5); 
}

.cat-label { flex: 1; font-size: 1.05rem; font-weight: 500; }

.cat-check {
    pointer-events: none; 
    width: 26px; height: 26px; border-radius: 50%;
    border: 1.5px solid #ccc; appearance: none; outline: none;
}

.cat-check:checked {
    background-color: #34A8DA; border-color: #34A8DA;
    background-image: url('data:image/svg+xml;utf8,<svg fill="white" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>');
    background-size: 16px; background-repeat: no-repeat; background-position: center;
}

.modal-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 30px; }
.clear-btn { background: none; border: none; font-weight: 600; color: #666; font-size: 0.9rem; }
.apply-btn { 
    background: #34A8DA; color: white; border: none; 
    padding: 16px 30px; border-radius: 5px; font-weight: 700;
}

/* =========================================
   9. INFO KARTICA LOKACIJE (Bottom Sheet)
   ========================================= */
#bottom-sheet {
    position: fixed; bottom: -100%; left: 0; width: 100%;
    background: white; border-radius: 20px 20px 0 0;
    padding: 20px; box-shadow: 0 -5px 30px rgba(0,0,0,0.1);
    z-index: 1000; transition: 0.4s ease-out;
}
#bottom-sheet.active { bottom: 0; }
.sheet-header { display: flex; gap: 15px; margin-bottom: 25px; }
#bs-image { width: 100px; height: 100px; object-fit: cover; border-radius: 12px; }
.sheet-actions { display: flex; border-top: 1px solid #eee; margin: 0 -20px -20px; }
.btn-action-primary, .btn-action-secondary {
    flex: 1; padding: 20px; text-align: center; text-decoration: none;
    font-weight: 700; color: #111; background: white; border: none;
}
.btn-action-primary { border-right: 1px solid #eee; color: var(--beige); }


/* =========================================
   10. APARTMENT INFO (FAQ STRANICA)
   ========================================= */
.info-content {
    background-color: var(--caffe-light);
    padding: 20px;
    flex-grow: 1; 
    overflow-y: auto; 
}

.faq-item {
    background: white;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.02); 
    border: 1px solid rgba(0,0,0,0.03); 
    overflow: hidden;
    transition: all 0.3s ease;
}

.faq-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px; cursor: pointer; font-family: 'Playfair Display', serif;
    font-weight: 600; font-size: 1.1rem; color: var(--dark);
    user-select: none;
}

.faq-icon {
    font-size: 1.6rem; font-weight: 300; color: var(--beige); 
    transition: transform 0.3s ease-out;
    line-height: 1;
}

.faq-body {
    max-height: 0; overflow: hidden; transition: max-height 0.4s ease-out;
    background: #fafafa;
}

.faq-body p {
    padding: 0 20px 25px;
    font-size: 0.95rem;
    color: #444; 
    line-height: 1.7; 
    white-space: pre-line; 
    margin: 0;
}

/* Active FAQ state */
.faq-item.active .faq-body { max-height: 300px; }
.faq-item.active .faq-icon { transform: rotate(45deg); }