/* ============================================================
   CoPet Map Page CSS
   Ported from CoPray PREV.css + PREV2.css + PR-s.css
   Colors: #007D06 (green) | #006400 (dark green)
   ============================================================ */

.map-container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 20px;
    opacity: 0;
    transition: opacity 0.5s ease;
}
.map-container.loaded { opacity: 1; }

body.loading { overflow: hidden !important; }

.red-bar {
    height: 3px;
    width: 100px;
    background: linear-gradient(135deg, #007D06, #006400);
    margin-bottom: 20px;
}

.search-container {
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    max-width: 600px;
}
.search-input {
    flex: 1;
    padding: 12px;
    border: 2px solid #007D06;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}
.search-input:focus { border-color: #006400; }
.search-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #007D06, #006400);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}
.search-button:hover { background: linear-gradient(135deg, #006400, #007D06); }

#map {
    height: 400px;
    width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    position: relative;
}

.error-message { color: #c0392b; margin-top: 5px; display: none; }

.filter-container {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.type-filter-dropdown { position: relative; min-width: 200px; }
.type-filter-button {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #007D06;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: border-color 0.3s;
    color: #006400;
}
.type-filter-button:hover, .type-filter-button.active { border-color: #006400; }
.type-filter-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #006400;
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.type-filter-item {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}
.type-filter-item:hover { background-color: #f0faf0; }
.type-filter-item:last-child { border-bottom: none; }
.type-count { color: #666; font-size: 14px; margin-left: auto; }
.clear-filters {
    background: linear-gradient(135deg, #007D06, #006400);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}
.clear-filters:hover { background: linear-gradient(135deg, #006400, #007D06); }

.statistics-section { padding: 4rem 0; margin-top: 2rem; }
.counter-box {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: transform 0.3s;
    height: 100%;
    border-top: 3px solid #007D06;
}
.counter-box:hover { transform: translateY(-5px); }
.counter-icon { font-size: 2.5rem; margin-bottom: 1rem; color: #007D06; }
.counter-number { font-size: 2.5rem; font-weight: 700; color: #006400; margin-bottom: 0.5rem; }
.counter-label { font-size: 1.1rem; color: #6c757d; margin-bottom: 0; }

@media (max-width: 768px) {
    .counter-box { margin-bottom: 1.5rem; }
    .statistics-section { padding: 2rem 0; }
}

.country-flag-link { display: block; text-decoration: none; color: #333; transition: all 0.3s; }
.country-flag-link:hover .card { transform: translateY(-5px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }
.country-flag-link.active .card { background-color: #f0faf0; border-color: #007D06; box-shadow: 0 0 0 0.2rem rgba(0,125,6,0.25); }
.flag-img { max-width: 70%; max-height: 70%; object-fit: contain; display: block; }
.flag-container { height: 160px; display: flex; align-items: center; justify-content: center; padding: 15px; background-color: #f0faf0; }
.card-body1 { padding: 1rem; background-color: #fff; }
.card-title { font-size: 17px !important; }

.marker-cluster-custom {
    background: rgba(0,125,6,0.85);
    border: 3px solid white;
    border-radius: 50%;
    color: white;
    height: 40px;
    line-height: 37px;
    text-align: center;
    width: 40px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    transition: all 0.3s;
}
.marker-cluster-custom:hover { transform: scale(1.1); background: #006400; }

.leaflet-popup-content-wrapper { background: transparent !important; border-radius: 0 !important; box-shadow: none !important; padding: 0 !important; margin: 0 !important; }
.leaflet-popup-content { margin: 0 !important; padding: 0 !important; line-height: 1 !important; min-height: auto !important; width: auto !important; }
.leaflet-popup-close-button { display: none !important; }
.leaflet-popup-tip { background: #006400 !important; border: none !important; box-shadow: none !important; }

.codoctor-loader {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: linear-gradient(135deg, #007D06 0%, #006400 50%, #007D06 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}
.codoctor-loader.hidden { opacity: 0; visibility: hidden; }

.loader-logo { width: 150px; height: auto; margin-bottom: 30px; animation: logoFloat 3s ease-in-out infinite; }
@keyframes logoFloat {
    0%, 100% { transform: translateY(0px) scale(1); filter: drop-shadow(0 10px 30px rgba(0,0,0,0.2)); }
    50%       { transform: translateY(-15px) scale(1.05); filter: drop-shadow(0 20px 40px rgba(0,0,0,0.3)); }
}

.loader-progress {
    width: 300px; height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 10px; overflow: hidden;
    margin-bottom: 20px; position: relative;
}
.loader-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, rgba(255,255,255,0.8) 0%, rgba(255,255,255,1) 50%, rgba(255,255,255,0.8) 100%);
    border-radius: 10px; width: 0%;
    transition: width 0.3s ease;
    position: relative; overflow: hidden;
}
.loader-progress-bar::before {
    content: ''; position: absolute;
    top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.6) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}
@keyframes shimmer { 0% { left: -100%; } 100% { left: 100%; } }

.loader-text { color: white; font-size: 16px; font-weight: 500; margin-bottom: 10px; opacity: 0.9; animation: textPulse 2s ease-in-out infinite; }
@keyframes textPulse { 0%, 100% { opacity: 0.9; } 50% { opacity: 0.7; } }

.loader-subtitle { color: rgba(255,255,255,0.8); font-size: 14px; font-weight: 300; text-align: center; max-width: 300px; line-height: 1.4; }

.loader-particles { position: absolute; width: 100%; height: 100%; overflow: hidden; }
.particle { position: absolute; background: rgba(255,255,255,0.15); border-radius: 50%; animation: particleFloat 20s linear infinite; }
.particle:nth-child(1) { width: 4px; height: 4px; left: 10%; animation-delay: 0s; }
.particle:nth-child(2) { width: 6px; height: 6px; left: 20%; animation-delay: 2s; }
.particle:nth-child(3) { width: 3px; height: 3px; left: 30%; animation-delay: 4s; }
.particle:nth-child(4) { width: 5px; height: 5px; left: 40%; animation-delay: 6s; }
.particle:nth-child(5) { width: 4px; height: 4px; left: 50%; animation-delay: 8s; }
.particle:nth-child(6) { width: 7px; height: 7px; left: 60%; animation-delay: 10s; }
.particle:nth-child(7) { width: 3px; height: 3px; left: 70%; animation-delay: 12s; }
.particle:nth-child(8) { width: 5px; height: 5px; left: 80%; animation-delay: 14s; }
.particle:nth-child(9) { width: 4px; height: 4px; left: 90%; animation-delay: 16s; }
@keyframes particleFloat {
    0%   { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10%  { opacity: 1; }
    90%  { opacity: 1; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

.leaflet-control-attribution a[title="A JS library for interactive maps"] { display: none !important; }
.leaflet-left { z-index: 999 !important; }
[type=button]:not(:disabled), [type=reset]:not(:disabled), [type=submit]:not(:disabled), button:not(:disabled) { gap: 5px !important; }

/* ── Show Directions button ── */
.google-maps-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1a73e8, #1558b0);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    box-shadow: 0 2px 6px rgba(26,115,232,0.3);
}
.google-maps-button:hover {
    background: linear-gradient(135deg, #1558b0, #1a73e8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26,115,232,0.4);
}

@media (max-width: 768px) {
    .loader-logo     { width: 100px; margin-bottom: 25px; }
    .loader-progress { width: 250px; }
    .loader-text     { font-size: 14px; }
    .loader-subtitle { font-size: 12px; max-width: 250px; }
}
