/* Variabile CSS pentru temă */
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-color: #ecf0f1;
    --dark-color: #2c3e50;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Reset și stiluri de bază */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f7fa;
    color: var(--primary-color);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    text-align: center;
}

header h1 {
    color: var(--primary-color);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    font-size: 2.5rem;
    font-weight: 700;
}

header h1 i {
    color: var(--secondary-color);
}

.subtitle {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 1.1rem;
    font-weight: 400;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.search-container {
    position: relative;
    flex: 1;
    max-width: 400px;
}

.search-container input {
    width: 100%;
    padding: 12px 45px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 30px;
    font-size: 16px;
    transition: var(--transition);
    background: white;
}

.search-container input:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-container i {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #7f8c8d;
}

.controls select {
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    min-width: 200px;
    background: white;
    cursor: pointer;
    transition: var(--transition);
}

.controls select:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

#resetFilters {
    padding: 12px 25px;
    background: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

#resetFilters:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

/* Hartă */
#map {
    height: 700px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin-bottom: 30px;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

/* Statistici */
#stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: var(--transition);
    border-left: 4px solid transparent;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.stat-card:nth-child(1) {
    border-left-color: var(--secondary-color);
}

.stat-card:nth-child(2) {
    border-left-color: var(--accent-color);
}

.stat-card:nth-child(3) {
    border-left-color: var(--success-color);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
}

.stat-card:nth-child(1) .stat-icon {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.stat-card:nth-child(2) .stat-icon {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.stat-card:nth-child(3) .stat-icon {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.stat-content h3 {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
}

.stat-content p {
    color: var(--primary-color);
    font-size: 32px;
    font-weight: 700;
    margin: 0;
}

/* Legenda */
.legend {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 300px;
    border: 1px solid #e0e0e0;
}

.legend h3 {
    margin-bottom: 15px;
    color: var(--primary-color);
    font-size: 18px;
    font-weight: 600;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.legend-item:hover {
    background-color: #f8f9fa;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Footer */
footer {
    text-align: center;
    padding: 20px;
    color: #7f8c8d;
    font-size: 14px;
    background: white;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* Stiluri pentru popup-uri pe hartă */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}

.leaflet-popup-content {
    margin: 20px;
    min-width: 280px;
    font-family: inherit;
}

.popup-title {
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 12px;
    font-size: 18px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
}

.popup-info {
    margin: 8px 0;
    color: #34495e;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-info strong {
    color: var(--primary-color);
    font-weight: 600;
}

.popup-coords {
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px dashed #ecf0f1;
}

/* Iconițe custom pe hartă */
.custom-div-icon {
    background: white;
    border: 3px solid;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    text-align: center;
    font-size: 10px;
    transition: transform 0.2s;
}

.custom-div-icon:hover {
    transform: scale(1.1);
}

/* Clustering stiluri */
.marker-cluster {
    background-clip: padding-box;
    border-radius: 20px;
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster div {
    background-color: rgba(110, 204, 57, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 20px;
    text-align: center;
    color: white;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.marker-cluster-small {
    background-color: rgba(110, 204, 57, 0.6);
}

.marker-cluster-small div {
    background-color: rgba(110, 204, 57, 0.6);
    width: 30px;
    height: 30px;
    font-size: 12px;
}

.marker-cluster-medium {
    background-color: rgba(241, 196, 15, 0.6);
}

.marker-cluster-medium div {
    background-color: rgba(241, 196, 15, 0.6);
}

.marker-cluster-large {
    background-color: rgba(231, 76, 60, 0.6);
}

.marker-cluster-large div {
    background-color: rgba(231, 76, 60, 0.6);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    #map {
        height: 500px;
    }
    
    .controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-container {
        max-width: none;
    }
    
    .controls select,
    #resetFilters {
        width: 100%;
        justify-content: center;
    }
    
    .stat-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .legend {
        max-width: none;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .stat-content p {
        font-size: 24px;
    }
}

/* Loading spinner */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255,255,255,0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Animations */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Tooltip styles */
.leaflet-tooltip {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    padding: 6px 10px;
}

/* Focus styles pentru accesibilitate */
a:focus,
button:focus,
input:focus,
select:focus {
    outline: 3px solid var(--secondary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .controls,
    #stats,
    .legend,
    footer {
        display: none;
    }
    
    #map {
        height: 100vh;
        border-radius: 0;
        box-shadow: none;
    }
}
