/* Trafic FM Interactive Map Plugin Styles */

/* Main Container */
.trafic-interactive-map-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Map Header */
.trafic-map-header {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.map-title h3 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.live-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-top: 5px;
}

.live-dot {
    width: 8px;
    height: 8px;
    background: #2ecc71;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.map-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.destination-search {
    display: flex;
    gap: 8px;
    align-items: center;
}

.trafic-input {
    padding: 8px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    min-width: 200px;
}

/* Buttons */
.trafic-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    text-decoration: none;
    white-space: nowrap;
}

.trafic-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.trafic-btn-primary {
    background: #3498db;
    color: white;
}

.trafic-btn-secondary {
    background: #95a5a6;
    color: white;
}

.trafic-btn-success {
    background: #2ecc71;
    color: white;
}

.trafic-btn-warning {
    background: #f39c12;
    color: white;
}

.trafic-btn-danger {
    background: #e74c3c;
    color: white;
}

.trafic-btn-info {
    background: #17a2b8;
    color: white;
}

.trafic-btn-google {
    background: #4285f4;
    color: white;
}

.trafic-btn-waze {
    background: #33ccff;
    color: white;
}

/* Incident Filters */
.trafic-incident-filters {
    background: #f8f9fa;
    padding: 15px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    border-bottom: 1px solid #dee2e6;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: 20px;
    background: white;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.filter-item:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.filter-item input[type="checkbox"] {
    margin: 0;
}

/* Map Wrapper */
.trafic-map-wrapper {
    display: flex;
    height: 600px;
    position: relative;
}

/* Leaflet Map */
.trafic-leaflet-map {
    flex: 1;
    height: 100%;
    z-index: 1;
}

/* Sidebar */
.trafic-map-sidebar {
    width: 350px;
    background: #fff;
    border-left: 1px solid #dee2e6;
    display: flex;
    flex-direction: column;
    z-index: 2;
}

.sidebar-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h4 {
    margin: 0;
    font-size: 1.1rem;
    color: #2c3e50;
}

.sidebar-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: #e9ecef;
    color: #495057;
}

/* Incidents List */
.incidents-list {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

.loading-incidents {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-size: 0.9rem;
}

.incident-item {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.incident-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
    transform: translateY(-1px);
}

.incident-type-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.incident-content {
    flex: 1;
}

.incident-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 0.95rem;
}

.incident-location {
    color: #6c757d;
    font-size: 0.85rem;
    margin-bottom: 3px;
}

.incident-time {
    color: #95a5a6;
    font-size: 0.8rem;
}

.incident-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.incident-actions button {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.incident-actions button:hover {
    background: #e9ecef;
    color: #495057;
}

.no-incidents {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.no-incidents-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.no-incidents-text {
    font-size: 0.9rem;
}

/* Navigation Panel */
.navigation-panel {
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 15px;
}

.navigation-panel h5 {
    margin: 0 0 15px 0;
    font-size: 1rem;
    color: #2c3e50;
}

.route-info {
    margin-bottom: 15px;
}

.route-info p {
    margin: 5px 0;
    font-size: 0.85rem;
    color: #6c757d;
}

.navigation-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.navigation-buttons .trafic-btn {
    font-size: 0.8rem;
    padding: 6px 10px;
    justify-content: center;
}

/* Modals */
.trafic-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: #f8f9fa;
    padding: 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 12px 12px 0 0;
}

.modal-header h4 {
    margin: 0;
    color: #2c3e50;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.modal-close:hover {
    background: #e9ecef;
    color: #495057;
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    background: #f8f9fa;
    padding: 15px 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    border-radius: 0 0 12px 12px;
}

/* Forms */
.trafic-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-header h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.form-header p {
    color: #6c757d;
    font-size: 0.95rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.form-help {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 5px;
}

.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.success-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    text-align: center;
    font-weight: 500;
}

/* Stats Widgets */
.trafic-live-stats {
    display: grid;
    gap: 20px;
    margin: 20px 0;
}

.trafic-live-stats.grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.trafic-live-stats.inline {
    grid-template-columns: repeat(4, 1fr);
}

.stat-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.stat-content {
    flex: 1;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
}

.stat-label {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.active-incidents .stat-icon {
    color: #e74c3c;
}

.total-incidents .stat-icon {
    color: #3498db;
}

.resolved-incidents .stat-icon {
    color: #2ecc71;
}

.last-update .stat-icon {
    color: #f39c12;
}

/* Recent Incidents Widget */
.trafic-recent-incidents {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.incidents-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.incidents-header h4 {
    margin: 0;
    color: #2c3e50;
}

.refresh-incidents {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.refresh-incidents:hover {
    background: #e9ecef;
    color: #495057;
}

.incidents-container {
    padding: 15px;
}

/* Radio Player */
.trafic-radio-player {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.player-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.station-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.station-logo {
    font-size: 2rem;
}

.station-details h4 {
    margin: 0;
    font-size: 1.2rem;
}

.station-tagline {
    font-size: 0.85rem;
    opacity: 0.8;
}

.player-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-indicator.offline {
    background: #e74c3c;
}

.status-indicator.online {
    background: #2ecc71;
    animation: pulse 2s infinite;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 15px;
}

.play-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.play-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: rgba(255, 255, 255, 0.5);
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.volume-slider {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    cursor: pointer;
}

.now-playing {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.now-playing-label {
    font-weight: 600;
    font-size: 0.85rem;
}

.current-song {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Emergency Contacts */
.trafic-emergency-contacts {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.contacts-header {
    background: #e74c3c;
    color: white;
    padding: 15px 20px;
    text-align: center;
}

.contacts-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.contacts-list {
    padding: 15px;
    display: grid;
    gap: 10px;
}

.trafic-emergency-contacts.horizontal .contacts-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.emergency-contact-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.emergency-contact-item:hover {
    background: #e9ecef;
    border-color: #3498db;
    text-decoration: none;
    color: inherit;
    transform: translateY(-1px);
}

.contact-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-info {
    flex: 1;
}

.contact-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 3px;
}

.contact-number {
    font-size: 1.1rem;
    font-weight: bold;
    color: #e74c3c;
    margin-bottom: 3px;
}

.contact-description {
    font-size: 0.8rem;
    color: #6c757d;
}

/* Weather Widget */
.trafic-weather-widget {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.weather-header h4 {
    margin: 0 0 15px 0;
    text-align: center;
}

.weather-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.weather-icon {
    font-size: 3rem;
}

.weather-temp {
    text-align: center;
}

.temperature {
    font-size: 2.5rem;
    font-weight: bold;
    display: block;
}

.weather-desc {
    font-size: 0.9rem;
    opacity: 0.9;
}

.weather-details {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 15px;
}

.detail-item {
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 10px;
}

.detail-label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 5px;
    opacity: 0.8;
}

.detail-value {
    font-weight: 600;
    font-size: 0.9rem;
}

.weather-alert {
    background: rgba(255, 193, 7, 0.2);
    border: 1px solid rgba(255, 193, 7, 0.5);
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-icon {
    font-size: 1.2rem;
}

.alert-text {
    font-size: 0.85rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .trafic-map-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .map-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .destination-search {
        width: 100%;
        justify-content: center;
    }
    
    .trafic-input {
        min-width: 150px;
        flex: 1;
    }
    
    .trafic-map-wrapper {
        flex-direction: column;
        height: auto;
    }
    
    .trafic-leaflet-map {
        height: 400px;
    }
    
    .trafic-map-sidebar {
        width: 100%;
        height: 300px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .trafic-live-stats.inline {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .weather-details {
        grid-template-columns: 1fr;
    }
    
    .navigation-buttons {
        grid-template-columns: 1fr;
    }
    
    .contacts-list {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 480px) {
    .trafic-interactive-map-container {
        border-radius: 0;
    }
    
    .trafic-map-header {
        padding: 15px;
    }
    
    .map-title h3 {
        font-size: 1.2rem;
    }
    
    .trafic-btn {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .trafic-incident-filters {
        padding: 10px 15px;
    }
    
    .filter-item {
        font-size: 0.8rem;
        padding: 4px 8px;
    }
    
    .trafic-leaflet-map {
        height: 300px;
    }
    
    .trafic-map-sidebar {
        height: 250px;
    }
    
    .sidebar-header {
        padding: 10px 15px;
    }
    
    .incidents-list {
        padding: 10px;
    }
    
    .incident-item {
        padding: 12px;
    }
    
    .trafic-live-stats.inline {
        grid-template-columns: 1fr;
    }
    
    .stat-item {
        padding: 15px;
    }
    
    .stat-number {
        font-size: 1.5rem;
    }
}

/* Custom Leaflet Marker Styles */
.trafic-marker {
    background: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    border: 3px solid;
}

.trafic-marker.accident {
    border-color: #e74c3c;
}

.trafic-marker.politie {
    border-color: #3498db;
}

.trafic-marker.ambuteiaj {
    border-color: #f39c12;
}

.trafic-marker.radar {
    border-color: #9b59b6;
}

.trafic-marker.lucrari {
    border-color: #e67e22;
}

.trafic-marker.atentionare {
    border-color: #f1c40f;
}

/* Severity indicators */
.trafic-marker.severity-low {
    opacity: 0.7;
}

.trafic-marker.severity-medium {
    opacity: 0.85;
}

.trafic-marker.severity-high {
    opacity: 1;
    animation: pulse-marker 2s infinite;
}

.trafic-marker.severity-critical {
    opacity: 1;
    animation: pulse-marker 1s infinite;
}

@keyframes pulse-marker {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .trafic-interactive-map-container {
        border: 2px solid #000;
    }
    
    .trafic-btn {
        border: 2px solid currentColor;
    }
    
    .incident-item {
        border: 2px solid #000;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .trafic-interactive-map-container {
        box-shadow: none;
        border: 1px solid #000;
    }
    
    .trafic-btn,
    .modal-close,
    .sidebar-toggle {
        display: none;
    }
    
    .trafic-map-wrapper {
        height: 400px;
    }
}