/* ==========================================================================
   GLOBALNI STILOVI
   ========================================================================== */
:root {
    --primary-red: #d94f3a;
    --primary-purple: #5237d7;
    --text-dark: #212529;
    --text-light: #f8f9fa;
    --shadow-soft: 0 8px 20px rgba(0,0,0,0.15);
    --shadow-strong: 0 12px 32px rgba(217,79,58,0.55);
    --blur: blur(0.5px);
}
/* Prisilno zalepi mapu za vrh ekrana – nema zelenog pojasa */
html, body {
    height: 100%;
    width: 95%;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    background: #89b879 !important;  /* zelena pozadina ako se pojavi pukotina */
}

#container {
    position: fixed !important;
    top: 0 !important;
    left: 30 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

#map {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #89b879 !important;  /* zelena ako se pojavi pukotina */
}

/* ==========================================================================
   DONJA PROVIDNA TRAKA (KATEGORIJE)
   ========================================================================== */
#bottom-bar {
    position: absolute;
    bottom: 0;
    left: 25%; /* Horizontalno pomeranje svih kategorijskig dugmadi od leve ivice  */
    width: 50%;
    height: 120px;
    background: transparent;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 900;
}
#bottom-bar > * {
    pointer-events: auto;
}

.left-group, .right-group {
    display: flex;
    gap: 60px;  /* Razmak između kategorijskih dugmadi (leve i desne grupe dugmadi) */
}
#bottom-bar.left .left-group,
#bottom-bar.left .right-group,
#bottom-bar.right .left-group,
#bottom-bar.right .right-group {
    flex-direction: column;
    gap: 80px;
    width: 100%;
    padding: 60px 0;
}
/* Kategorijski dugmići */
.category-btn {
    width: 80px;
    height: 80px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-soft);
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    box-sizing: border-box;
    position: relative;
    overflow: hidden;
    opacity: 0.42;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid rgba(255, 255, 255, 0.28);
}
.category-btn .btn-text {
    color: white;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    line-height: 1.3;
    text-shadow: 0 1px 1px rgba(0,0,0,0.4);
}
.category-btn:not(.active) {
    animation: subtleBreathe 10s ease-in-out infinite;
}
@keyframes subtleBreathe {
    0%, 100% { opacity: 0.82; }
    50% { opacity: 0.90; }
}
.category-btn.active {
    opacity: 1;
    background: rgba(255, 255, 255, 0.28);
    border: 3px solid rgba(255, 255, 255, 0.75);
    box-shadow: var(--shadow-strong);
    backdrop-filter: var(--blur);
}
.category-btn:hover:not(.active) {
    opacity: 0.94;
    transform: scale(1.06);
    box-shadow: 0 16px 40px rgba(0,0,0,0.3);
}
.category-btn .btn-text,
.category-btn .btn-icon {
    filter: drop-shadow(0 1px 4px rgba(0,0,0,0.65));
    opacity: 1;
}
/* Gradijenti dugmadi */
.udruge-btn { background: linear-gradient(135deg, #5237d7, #e4097f); }
.manifestacije-btn { background: linear-gradient(135deg, #da3030, #f5927a); }
.nematerijalna-btn { background: linear-gradient(135deg, #3221b9, #06a9eb); }
.materijalna-btn { background: linear-gradient(135deg, #f76301, #fecb09); }

/* ==========================================================================
   CENTRALNO DUGME "POČETAK"
   ========================================================================== */
#center-btn {
    position: absolute;
    bottom: 20px; /* rastojanje od donje ivice */
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #fe0909, #e4097f);
    color: white;
    font-size: 12px;
    font-weight: bold;
    opacity: 0.64;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 6px 14px rgba(0,0,0,0.2);
    z-index: 1000;
}
#center-btn:hover {
    transform: translateX(-50%) scale(1.1);
    box-shadow: 0 8px 20px rgba(217,79,58,0.4);
}

/* ==========================================================================
   SIDEBAR – proziran, zamućen, lebdi iznad mape
   ========================================================================== */
#sidebar {
    position: fixed;
    top: 0;
    right: -520px;
    width: 520px;
    height: 100%;
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: -20px 0 50px rgba(0,0,0,0.25);
    z-index: 2500;
    transition: right 0.6s cubic-bezier(0.25, 0.8, 0.25, 1);
    overflow-y: auto;
    padding: 0;
    color: #1a1a2e;
    font-size: 1.25rem;
    display: none;
    opacity: 0;
    border-left: 3px solid rgba(217, 79, 58, 0.2);
}
#sidebar.visible {
    right: 0;
    display: block;
    opacity: 1;
    box-shadow: -25px 0 60px rgba(0,0,0,0.35);
}

/* Sidebar header */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 28px 32px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.7);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 10;
}
#sidebar-title {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a1a2e;
}
#sidebar-close {
    background: none;
    border: none;
    font-size: 2.6rem;
    color: #d94f3a;
    cursor: pointer;
    line-height: 1;
    padding: 0 8px;
    transition: transform 0.2s ease, color 0.2s ease;
}
#sidebar-close:hover {
    color: #b83e2d;
    transform: rotate(90deg);
}

/* Sidebar body */
.sidebar-body {
    padding: 32px;
}
#sidebar-desc {
    line-height: 1.7;
    color: #333;
    margin-bottom: 2.5rem;
}
#sidebar-images {
    display: grid;
    gap: 1.5rem;
}
#sidebar-images img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transition: transform 0.3s ease;
}
#sidebar-images img:hover {
    transform: scale(1.03);
}
#sidebar-images p {
    text-align: center;
    color: #777;
    font-style: italic;
    padding: 2rem 0;
}
/* Sakrij scrollbar potpuno */
.sidebar-body::-webkit-scrollbar { display: none; }
.sidebar-body { -ms-overflow-style: none; scrollbar-width: none; overscroll-behavior: contain; }

/* Scroll hint */
.sidebar-scroll-hint {
    position: absolute;
    top: 50%;
    right: 80px;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    opacity: 0;
    pointer-events: none;
    z-index: 3000;
    transition: opacity 0.5s ease, right 0.4s ease;
}
.sidebar-scroll-hint.visible {
    opacity: 0.9;
    right: 70px;
}
.sidebar-scroll-hint img {
    width: 100%;
    height: 100%;
    animation: subtlePulse 4s infinite ease-in-out;
}
@keyframes subtlePulse {
    0%, 100% { transform: scale(1) translateY(0); opacity: 0.9; }
    50% { transform: scale(1.15) translateY(-6px); opacity: 1; }
}

/* ==========================================================================
   SETUP dugme
   ========================================================================== */
#setup-btn {
    position: fixed;
    bottom: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 50%;
    font-size: 1.8rem;
    color: var(--primary-red);
    cursor: pointer;
    z-index: 9999;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}
#setup-btn:hover {
    background: rgba(217,79,58,0.25);
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(217,79,58,0.35);
}

/* ==========================================================================
   SETUP POPUP
   ========================================================================== */
.setup-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.setup-popup.visible {
    display: flex;
    opacity: 1;
}
.setup-content {
    background: white;
    border-radius: 24px;
    padding: 50px 60px;
    max-width: 75vw;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    position: relative;
    border: 5px solid #d94f3a;
    text-align: left;
}
.setup-close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    
    /* Centriranje X-a – najvažnije! */
    display: flex;
    align-items: center;
    justify-content: center;
    
    width: 48px;          /* okruglo – prilagodi po potrebi */
    height: 48px;
    padding: 0;           /* ukloni padding da X bude u centru */
    
    font-size: 2.2rem;    /* veći X za bolju vidljivost */
    font-weight: bold;
    color: #d94f3a;
    background: rgba(217,79,58,0.08);
    border: 2px solid #d94f3a;
    border-radius: 50%;   /* savršeno kružno dugme */
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
}

.setup-close-btn:hover {
    background: #d94f3a;
    color: white;
    transform: translateY(-2px) scale(1.1); /* lagano povećanje + lift */
    box-shadow: 0 8px 20px rgba(217,79,58,0.4);
}

/* X je stavljeno direktno u HTML */
.setup-close-btn::after {
    content: none;
}

/* ==========================================================================
   Popup animacija (SG fade + flip)
   ========================================================================== */
.custom-popup .leaflet-popup-content-wrapper {
    animation: sgFadeFlip 0.6s ease-out forwards;
    transform-origin: bottom center;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(217,79,58,0.3);
    padding: 20px 28px;
    font-size: 1.35rem;
}
.custom-popup .leaflet-popup-tip-container,
.custom-popup .leaflet-popup-tip {
    display: none !important;
}
@keyframes sgFadeFlip {
    0%   { opacity: 0; transform: scaleY(0); }
    50%  { opacity: 0.5; transform: scaleY(0.5); }
    100% { opacity: 1; transform: scaleY(1); }
}

/* ==========================================================================
   OSTALI ELEMENTI
   ========================================================================== */
.leaflet-tooltip-custom {
    background: rgba(0,0,0,0.88);
    color: white;
    font-size: 1.3rem;
    padding: 8px 14px;
    border-radius: 8px;
}
.leaflet-marker-icon {
    width: 50px !important;
    height: 50px !important;
}
.leaflet-marker-spider-leg {
    stroke-width: 3px !important;
    stroke-opacity: 0.9 !important;
}
/* Darkroom logo */
#darkroom-logo-container {
	position: fixed;
    bottom: 2px;  /* Darkroom logo rastojanje od dna stranice */
    left: 80px;   /* Darkroom logo rastojanje od leve ivice */
    z-index: 1200;
    pointer-events: none;
}
#darkroom-logo {
    width: 120px !important;           /* za 4K kiosk – može se povećati ili smanjiti ako treba */
    max-width: 120px !important;
    height: auto !important;
    filter: drop-shadow(0 6px 14px rgba(0,0,0,0.4));
}

/* Na manjim ekranima (opcija) */
@media (max-width: 1024px) {
    #darkroom-logo {
        width: 60px !important;
        max-width: 80px !important;
    }
}
/* Pulsirajući klasteri */
@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 16px rgba(0,0,0,0.4),
                    0 0 0 0 rgba(217,79,58,0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 4px 24px rgba(0,0,0,0.6),
                    0 0 10px rgba(217,79,58,0.7);
        transform: scale(1.05);
    }
}
@keyframes pulse-ring {
    0%   { transform: scale(0.4); opacity: 0.6; }
    50%  { transform: scale(0.8); opacity: 0.3; }
    100% { transform: scale(1.2); opacity: 0; }
}
.custom-cluster .pulsating-cluster {
    animation: pulse-glow 2s ease-in-out infinite;
}
.custom-cluster .pulse-ring {
    animation: pulse-ring 2s ease-in-out infinite;
}
.custom-cluster:hover .pulsating-cluster,
.custom-cluster:active .pulsating-cluster {
    animation-duration: 1.2s !important;
    transform: scale(1.1) !important;
}

/* Našminkani subcategory tagovi */
.subcategory-tag {
    cursor: pointer;
}
.subcategory-tag:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(0,0,0,0.35) !important;
    transition: all 0.3s ease;
}
.fa-bounce {
    animation-duration: 1.5s !important;
}
/* Dugmad za online/offline rad u setup popup-u */
.tile-switch-btn {
    padding: 10px 20px;
    margin: 5px;
    border: 2px solid #d94f3a;
    border-radius: 12px;
    background: rgba(217,79,58,0.1);
    color: #d94f3a;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}
.tile-switch-btn.active {
    background: #d94f3a;
    color: white;
}
.tile-switch-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(217,79,58,0.4);
}
/* Marker SVG */
.svg-marker svg {
    transition: transform 0.3s ease, fill 0.3s ease;
}
.svg-marker svg path {
    transition: fill 0.3s ease;
}

