/* ==================== */
/* GLOBAL STYLES */
/* ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

body {
    margin-top: 120px;
    background-color: #c9d6ff;
    background: linear-gradient(to right, white, #c9d6ff);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* ==================== */
/* MAP CONTAINER STYLES */
/* ==================== */
.map-container {
    display: flex;
    position: relative;
    width: 80vw; /* 80% of viewport width */
    max-width: 1400px;
    min-width: 300px; /* Prevent becoming too small */
    margin: 20px auto;
    gap: 30px;
    padding: 0 20px;
    flex: 1;
    justify-content: center; /* Center contents */
}

/* ==================== */
/* MAP SPECIFIC STYLES */
/* ==================== */
#map {
    width: 55%; 
    height: 80vh; /* 80% of viewport height */
    max-height: 750px;
    min-height: 400px; /* Prevent becoming too small */
    border: 1px solid #ccc;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: #f8f9fa;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.map-controls {
    position: absolute;
    top: 15px;
    right: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.filter-button {
    background-color: rgba(5, 6, 45, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: bold;
    position: relative; 
    
}

.filter-button:hover {
    background-color: rgba(5, 6, 45, 1);
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(0,0,0,0.4);
}

.filter-dropdown {
    display: none;
    background-color: white;
    padding: 15px;
    border-radius: 6px;
    margin-top: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    width: 200px;
    position: absolute;
    right: 0;
    text-align: center;

}

.filter-dropdown label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: #444a85;
    font-size: 15px;
}

.filter-dropdown select {
    width: 90%;
    padding: 10px 8px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto;
    display: block;
}

.filter-button.active + .filter-dropdown {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}




/* ==================== */
/* MAP MARKERS/PINS */
/* ==================== */
.leaflet-marker-icon{
   align-self:last baseline;
    max-width: 25px; /* Maximální šířka */
    max-height: 25px; /* Maximální výška */
}

/* User location icon styling */
.user-location-icon {
  filter: drop-shadow(0 2px 3px rgba(0,0,0,0.3));
  z-index: 1000; /* Ensure it appears above other markers */
}

/* Improve rendering quality */
.leaflet-marker-icon img {
  image-rendering: crisp-edges;
  image-rendering: -moz-crisp-edges;
  image-rendering: -webkit-optimize-contrast;
}
.leaflet-marker-shadow {
    /* Ensures markers stay aligned with map coordinates */
    position: absolute;
    transform-origin: center bottom;
}

/* Base marker style */
/* Container for the pin - handles positioning */
.map-pin {
    position: relative;
    width: 24px;
    height: 24px;
    transform: none; /* Reset transform for container */
    left: 0;
    top: 0;
    margin: 0;
  }
  
  /* Actual pin element - all styling goes here */
  .pin-inner {
    width: 24px;
    height: 24px;
    border-radius: 50% 50% 50% 0;
    background: #e74c3c;
    position: absolute;
    transform: rotate(-45deg);
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: all 0.3s ease;
  }
  
  /* Pin point */
  .pin-inner::after {
    content: '';
    width: 12px;
    height: 12px;
    margin: 6px 0 0 6px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
  }
  
  /* Different pin types */
  .map-pin .hospital .pin-inner {
    background: #3498db;
  }
  
  .map-pin .school .pin-inner {
    background: #2ecc71;
  }
  
  .map-pin .landmark .pin-inner {
    background: #f39c12;
  }
  
  /* Pin animation on hover */
  .map-pin:hover .pin-inner {
    transform: rotate(-45deg) scale(1.2);
    z-index: 1000;
  }

/* Cluster markers */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 50%;
    background-color: rgba(231, 76, 60, 0.6);
}

.marker-cluster div {
    width: 30px;
    height: 30px;
    margin-left: 5px;
    margin-top: 5px;
    background-color: rgba(231, 76, 60, 0.8);
    color: white;
    font-weight: bold;
    text-align: center;
    border-radius: 50%;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Ensure popups appear correctly relative to pins */
.leaflet-popup {
    position: absolute;
    text-align: center;
    margin-bottom: 20px;
}

.leaflet-popup-content-wrapper {
    transform: translateY(-10px);
}


/* ==================== */
/* COMPLETE PLACE INFO PANEL WITH CUSTOM SCROLL */
/* ==================== */
#place-info {
    width: 45%;
    height: 80vh;
    max-height: 750px;
    min-height: 400px;
    position: relative;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 20px;
    display: flex;
    flex-direction: column;
    /* CHANGED FROM overflow: hidden TO: */
    overflow-y: auto; /* This enables vertical scrolling */
    scrollbar-width: thin; /* For Firefox */
    scrollbar-color: #3498db #f1f5f9; /* For Firefox */
}

/* Remove the duplicate scrollbar styles and keep this single definition: */
#place-info::-webkit-scrollbar {
    width: 10px;
}

#place-info::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 5px;
    margin: 15px 0;
}

#place-info::-webkit-scrollbar-thumb {
    background: linear-gradient(#3498db, #2980b9);
    border-radius: 5px;
    border: 2px solid #f1f5f9;
}

#place-info::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(#2980b9, #2472a4);
}

/* Remove the other scrollbar styles (the ones near the bottom of your CSS) */


#place-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    z-index: 2;
}

.place-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.toggle-info-btn {
    background: rgba(0, 0, 0, 0.03);
    border: none;
    color: #5f6c80;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.toggle-info-btn:hover {
    background: rgba(0, 0, 0, 0.08);
    color: #2c3e50;
    transform: rotate(90deg);
}

.place-info-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Action Buttons - Modern Glassmorphism */
.action-btn {
    background: linear-gradient(135deg, rgba(52, 152, 219, 0.9) 0%, rgba(41, 128, 185, 0.9) 100%);
    color: white;
    border: none;
    padding: 12px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 2px 10px rgba(52, 152, 219, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    background: linear-gradient(135deg, rgba(41, 128, 185, 0.95) 0%, rgba(31, 97, 141, 0.95) 100%);
    transform: translateY(-2px);
    box-shadow: 
        0 4px 15px rgba(52, 152, 219, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn.primary {
    background: linear-gradient(135deg, rgba(46, 204, 113, 0.9) 0%, rgba(39, 174, 96, 0.9) 100%);
    box-shadow: 
        0 2px 10px rgba(46, 204, 113, 0.2),
        0 1px 2px rgba(0, 0, 0, 0.1);
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, rgba(39, 174, 96, 0.95) 0%, rgba(33, 150, 83, 0.95) 100%);
    box-shadow: 
        0 4px 15px rgba(46, 204, 113, 0.3),
        0 2px 4px rgba(0, 0, 0, 0.1);
}

.selected-place-info {
    background: rgb(255, 255, 255);
    border-radius: 14px;
    margin: 80px auto 0; /* This sets top margin to 90px, left/right to auto */
    padding: 30px 25px;
    text-align: center;
    width: 85%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 6px 20px rgba(52, 152, 219, 0.12),
        0 3px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(52, 152, 219, 0.1);
    cursor: pointer;

}
/* ==================== */




.add-route-box {
    background: rgb(255, 255, 255);
    border-radius: 14px;
    margin: 60px auto 0; /* This sets top margin to 90px, left/right to auto */
    padding: 30px 25px;
    text-align: center;
    width: 85%;
    max-width: 380px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    box-shadow: 
        0 6px 20px rgba(52, 152, 219, 0.12),
        0 3px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.25s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(52, 152, 219, 0.1);
    cursor: pointer;
}
.add-route-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    transition: all 0.3s ease;
}

.add-route-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 0%, rgba(52, 152, 219, 0.08) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.add-route-box:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 10px 25px rgba(52, 152, 219, 0.18),
        0 5px 10px rgba(0, 0, 0, 0.08);
    border-color: rgba(52, 152, 219, 0.2);
}

.add-route-box:hover::after {
    opacity: 1;
}

.add-route-box:active {
    transform: translateY(-1px);
    box-shadow: 
        0 5px 15px rgba(52, 152, 219, 0.15),
        0 2px 5px rgba(0, 0, 0, 0.06);
}

.add-route-box h3 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 1.4rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
    width: 100%;
}

.add-route-box h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #2ecc71);
    border-radius: 3px;
}

.add-route-box p {
    color: #64748b;
    margin-bottom: 30px;
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 90%;
}

.action-btn {
    background: linear-gradient(135deg, #3498db 0%, #2ecc71 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 10px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #2ecc71 0%, #3498db 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.action-btn:hover::before {
    opacity: 1;
}

.action-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.3);
}
/* Custom scrollbar for WebKit browsers */
#place-info::-webkit-scrollbar {
    width: 8px;
}

#place-info::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 0 12px 12px 0;
    margin: 10px 0;
}

#place-info::-webkit-scrollbar-thumb {
    background-color: #3498db;
    border-radius: 4px;
    border: 2px solid #f1f5f9;
    transition: background-color 0.2s;
}

#place-info::-webkit-scrollbar-thumb:hover {
    background-color: #2980b9;
}

/* Firefox scrollbar */
@supports (scrollbar-color: red blue) {
    #place-info {
        scrollbar-color: #3498db #f1f5f9;
        scrollbar-width: thin;
    }
}

/* Decorative left border */
#place-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 5px;
    height: 100%;
    background: linear-gradient(to bottom, #3498db, #2c3e50);
    border-radius: 12px 0 0 12px;
}

/* Header styles */
#place-info h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
    position: relative;
    padding-bottom: 10px;
}

#place-info h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(to right, #3498db, #2c3e50);
    border-radius: 3px;
}

/* Content styles */
#place-info p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Section cards */
.place-detail-section {
    margin-bottom: 20px;
    padding: 18px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-left: 3px solid transparent;
}

.place-detail-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-left-color: #3498db;
}

.place-detail-section h4 {
    color: #2c3e50;
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.place-detail-section h4 i {
    margin-right: 10px;
    color: #3498db;
    font-size: 1.1rem;
}

/* Subsection styles */
.place-detail-subsection {
    margin: 12px 0 12px 15px;
    padding: 12px 15px;
    border-left: 3px solid #3498db;
    background-color: #f8fafc;
    border-radius: 0 6px 6px 0;
    transition: background-color 0.2s;
}

.place-detail-subsection:hover {
    background-color: #edf2f7;
}

.place-detail-subsection p {
    margin: 8px 0;
    font-size: 0.95rem;
    color: #4a5568;
}

/* Action buttons */
.place-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn i {
    font-size: 0.9em;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: #f1f5f9;
    color: #2c3e50;
    border: 1px solid #e2e8f0;
}

.btn-secondary:hover {
    background-color: #e2e8f0;
    transform: translateY(-1px);
}

/* Smooth scrolling */
@media (prefers-reduced-motion: no-preference) {
    #place-info {
        scroll-behavior: smooth;
    }
}

/* Responsive design */
@media (max-width: 768px) {
    #place-info {
        width: 100%;
        max-height: 400px;
        border-left: none;
        border-top: 1px solid #e0e0e0;
        padding: 20px 15px;
    }
    
    #place-info::before {
        width: 100%;
        height: 5px;
        background: linear-gradient(to right, #3498db, #2c3e50);
    }
    
    .place-detail-section {
        padding: 15px;
    }
    
    /* Thinner scrollbar on mobile */
    #place-info::-webkit-scrollbar {
        width: 6px;
    }
}

/* Empty state styling */
#place-info:empty::after {
    content: 'Vyberte místo na mapě pro zobrazení detailů';
    display: block;
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    padding: 30px 0;
}
/* ==================== */
/* LEAFLET OVERRIDES */
/* ==================== */
.leaflet-popup-content-wrapper {
    background: rgba(252, 252, 252, 0.9);
    border-radius: 10px;
    box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
    padding: 5px;
    max-height: 80vh;
    overflow: hidden;
}

.leaflet-popup-content {
    font-size: 12px;
    max-width: 250px !important;
    text-align: left;
    max-height: 60vh;
    overflow-y: auto;
}

.leaflet-popup-tip {
    background: rgba(255, 34, 34, 0.9);
}

.hidden-circle {
    display: none;
}

  
  /* Hover effects */
  #find-me:hover {
    background-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  
  /* Active/pressed state */
  #find-me:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  }
  
  /* When geolocation is active */
  #find-me.active {
    background-color: #2196F3; /* Blue */
    animation: pulse 1.5s infinite;
  }
  
  /* Loading/pulse animation */
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(33, 150, 243, 0); }
    100% { box-shadow: 0 0 0 0 rgba(33, 150, 243, 0); }
  }
  
  /* Mobile responsiveness */
  @media (max-width: 768px) {
    #find-me {
      bottom: 10px;
      right: 10px;
      padding: 8px 16px;
      font-size: 12px;
    }
  }



/* ==================== */
/* FOOTER STYLES */
/* ==================== */
footer {
    background-color: #2c3e50;
    color: white;
    text-align: center;
    padding: 1.5rem;
    width: 100%;
    margin-top: auto;
}

/* ==================== */
/* RESPONSIVE ADJUSTMENTS */
/* ==================== */
@media (max-width: 1200px) {
    .map-container {
        flex-direction: column;
        align-items: center;
    }
    
    #map {
        width: 100%;
    }
    
    #place-info {
        border-left: none;
        border-top: 2px solid #ccc;
        border-radius: 0 0 8px 8px;
        max-height: 400px;
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 768px) {
    
    .map-container {
        padding: 0 10px;
        gap: 15px;
    }
    
    #map {
        height: 500px;
    }
    
    
    .filter-button {
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .filter-dropdown {
        width: 180px;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    #map {
        height: 400px;
    }
    
    #place-info {
        padding: 10px;
    }
    
    .place-detail-section {
        margin-bottom: 10px;
    }
}




.search-container {
    position: absolute;
    top: 15px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: 300px;
}

#location-search {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    font-size: 16px;
}

#search-results {
    display: none;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-top: 5px;
    max-height: 300px;
    overflow-y: auto;
}

.search-result {
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result:hover {
    background: #f8f9fa;
}

.search-result-name {
    font-weight: 600;
    color: #2c3e50;
}

.search-result-meta {
    font-size: 12px;
    color: #7f8c8d;
}

.no-results {
    padding: 16px;
    text-align: center;
    color: #7f8c8d;
}