/* Global styles */
html,
body {
    box-sizing: border-box; /* Ključno za ispravan box model sa paddingom */
    height: 100%; /* Ensure html and body take full viewport height */
    width: 100%; /* Ensure html and body take full viewport width */
    margin: 0;
    padding: 0;
    font-family: 'Times New Roman', Times, serif; /* Primary font for body */
    background-color: #211B0D; /* Dark brown/black background */
    color: #E0E0E0; /* Light grey text for contrast */
    overflow-x: hidden; /* Prevent horizontal scrollbar from overflow */
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Ensure body takes at least full viewport height */
}

/* Main Heading Style */
h1 {
    font-family: 'Cinzel', serif; /* Specific font for headings */
    font-weight: 700; /* Bold for impact */
    color: #DAA520; /* Golden color for title */
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5); /* Stronger shadow */
}

/* Navigation Bar */
.navbar {
    background-color: #1a150a !important; /* Even darker shade for navbar */
    border-bottom: 1px solid #443c2c !important; /* Subtle border */
}

.navbar-brand,
.navbar-nav .nav-link {
    color: #DAA520 !important; /* Golden text for brand and links */
    font-family: 'Cinzel', serif;
    font-weight: 700;
}

.navbar-nav .nav-link:hover {
    color: #FFD700 !important; /* Brighter gold on hover */
}

/* Map container */
/* Preselićemo specifične stilove mape u map.css radi jasnijeg prioriteta */
#map {
    margin-bottom: 20px;
    border: 1px solid #443c2c;
    border-radius: 8px;
    overflow: hidden;
    position: relative; /* Važno za pravilno pozicioniranje Leaflet slojeva */
}

/* Filter controls styling */
.filter-btn {
    margin: 5px; /* Spacing between buttons */
    border-radius: 20px; /* Pill-shaped buttons */
    padding: 8px 20px;
    transition: all 0.3s ease; /* Smooth transitions for hover/active states */
    background-color: #443c2c; /* Darker background for buttons */
    color: #DAA520; /* Golden text for buttons */
    border-color: #DAA520; /* Golden border */
}

.filter-btn.active,
.filter-btn:hover {
    background-color: #DAA520 !important; /* Golden background on hover/active */
    color: #211B0D !important; /* Dark text on golden background */
    border-color: #FFD700 !important; /* Brighter golden border */
    border-width: 3px; /* Zadebljan border */
    border-style: solid; /* Osiguraj da je stil solidan */
    transform: translateY(-2px); /* Slight lift on hover/active */
    box-shadow: 0 4px 8px rgba(0,0,0,0.3); /* Stronger shadow on hover/active */
}

/* Main content area */
main {
    flex-grow: 1; /* Allow main content to take all available space */
    display: flex; /* Make main a flex container */
    flex-direction: column; /* Arrange content in a column */
    width: 100%; /* Ensure main takes full width */
    height: 100%; /* Ensure main takes full height within its flex parent */
    padding: 0 1.5rem; /* Dodajem horizontalni padding */
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}

/* Footer styles */
footer, .footer, footer.text-muted {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 0;
    width: auto;
    min-width: unset;
    max-width: 100vw;
    background: transparent !important;
    /*color: #bfa96a !important;*/
    z-index: 1000;
    box-shadow: none;
    padding: 0.05rem 0.4rem 0.05rem 0.4rem !important;
    margin: 0 !important;
    border: none !important;
    font-size: 0.78rem;
    min-height: unset;
    height: auto;
    border-radius: 0;
    text-align: center;
    opacity: 0.4;
    letter-spacing: 0.08em;
    max-height: 15px;
    margin-top: 12px !important;
}

/* Forsiraj prikaz legend-toggle dugmeta na svim uređajima */
.legend-toggle {
    display: flex !important;
}

/* Responsive font sizes */
html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Bootstrap focus override for better aesthetics */
.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem #DAA520, 0 0 0 0.25rem #FFD700; /* Golden focus ring */
}

/* Ensure footer is at bottom */
html {
  position: relative;
  min-height: 100%; /* Ensure html takes at least full viewport height */
}

body {
  margin-bottom: 0; /* Remove fixed margin-bottom as flexbox will manage footer position */
}

/* Basic container padding for content */
.container {
    padding-top: 20px;
    padding-bottom: 20px;
    background-color: #2b2313; /* Slightly lighter dark for container background */
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    height: 100%; /* Ensure container takes full available height */
    width: 100%; /* Ensure container takes full available width */
    max-width: none; /* Remove max-width restriction */
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Arrange content in a column */
    flex-grow: 1; /* Allow it to grow and take available space */
}

/* Legend styles for mobile */
@media (max-width: 768px) {
    .legend {
        position: fixed;
        right: 10px;
        left: unset;
        bottom: 70px;
        top: unset;
        max-width: 95vw;
        min-width: 180px;
        font-size: 0.95em;
        padding: 10px;
    }
}

/* Legend toggle button - always visible */
.legend-toggle {
    position: fixed;
    bottom: 80px;
    right: 10px;
    background: #443c2c;
    color: #DAA520;
    border: 2px solid #DAA520;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 22px;
    z-index: 1001;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.legend-toggle:hover {
    background: #DAA520;
    color: #211B0D;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
}

/* Legend container - always visible */
.legend {
    position: static !important;
    width: 100%;
    max-width: 1100px;
    margin: 24px auto 0 auto;
    background: #221a0a;
    color: #DAA520;
    font-size: 1em;
    z-index: 1;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    display: block;
    border: 1px solid #DAA520;
    margin-bottom: 20px;
}

@media (max-width: 1200px) {
    .legend {
        max-width: 98vw;
        font-size: 0.95em;
        padding: 10px;
    }
}

@media (min-width: 769px) {
    .legend {
        position: absolute;
        top: 10px;
        right: 10px;
        bottom: unset;
    }
}

@media (max-width: 768px) {
    .legend {
        position: fixed;
        right: 10px;
        left: unset;
        bottom: 70px;
        top: unset;
        max-width: 95vw;
        min-width: 180px;
        font-size: 0.95em;
        padding: 10px;
    }
}

.legend-title {
    font-family: 'Cinzel', serif;
    font-weight: 700;
    color: #DAA520;
    font-size: 1.35em;
    letter-spacing: 0.08em;
    text-align: center;
    margin-bottom: 0.5em;
}

.legend img {
    border-radius: 50% !important;
    border: 2px solid #DAA520;
    box-shadow: 0 2px 8px rgba(218,166,32,0.10);
    background: #f9e7b0;
    padding: 2px;
    transition: transform 0.3s cubic-bezier(.4,2,.6,1) !important; 
    box-shadow: 0.3s !important;
    will-change: transform;
    animation: none !important;
}

.legend img:hover {
    transform: rotate(15deg) scale(1.08) !important;
    box-shadow: 0 0 18px 4px #FFD70088, 0 12px 32px 0 rgba(0,0,0,0.35), 0 8px 24px rgba(218,166,32,0.18) !important;
    z-index: 2;
}

.popup-details-link {
    color: #8c6b2c !important;
    background: none !important;
    border: 1px solid #bfa96a !important;
    font-weight: 600;
    font-style: italic;
    border-radius: 6px;
    padding: 2px 12px;
    transition: background 0.2s, color 0.2s;
}
.popup-details-link:hover {
    background: #bfa96a !important;
    color: #211B0D !important;
}