/* Incidents List Button - Desktop */
.incidents-list-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    z-index: 10;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border: none;
    border-radius: 28px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(25, 118, 210, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.incidents-list-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.incidents-list-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(25, 118, 210, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.incidents-list-btn:hover::before {
    left: 100%;
}

.incidents-list-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(25, 118, 210, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
}

.incidents-list-btn svg {
    flex-shrink: 0;
}

/* Filters Button - Desktop */
.filters-btn {
    position: fixed;
    bottom: 85px;
    left: 20px;
    z-index: 10;
    background: linear-gradient(135deg, #7b1fa2 0%, #6a1b9a 100%);
    color: white;
    border: none;
    border-radius: 28px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(123, 31, 162, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.filters-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.filters-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 31, 162, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.filters-btn:hover::before {
    left: 100%;
}

.filters-btn:active {
    transform: translateY(0px);
    box-shadow: 0 2px 8px rgba(123, 31, 162, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
}

.filters-btn svg {
    flex-shrink: 0;
}

/* Desktop Filters Panel - Hidden by default */
.map-controls.desktop-only {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.map-controls.desktop-only.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* Close button hover effect */
.close-filters-btn:hover {
    background: var(--surface) !important;
}

/* Incidents List Modal Improvements */
#incidentsListModal .modal-content {
    animation: slideInUp 0.3s ease-out;
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#incidentsListContent {
    padding: 1.5rem;
}

#incidentsListContent::-webkit-scrollbar {
    width: 8px;
}

#incidentsListContent::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

#incidentsListContent::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

#incidentsListContent::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Improved incident cards in modal */
.incident-card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    background: var(--surface);
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.incident-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--primary-color);
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.incident-card:hover {
    box-shadow: 0 4px 12px var(--shadow-elevation);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.incident-card:hover::before {
    transform: scaleY(1);
}

.incident-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.incident-card-title {
    margin: 0 0 0.25rem 0;
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 600;
}

.incident-card-date {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.incident-card-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}

.incident-card-reporter {
    margin: 0.75rem 0;
    padding: 0.5rem;
    background: var(--surface-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
}

.incident-card-reporter strong {
    color: var(--text-primary);
}

.incident-card-reporter span {
    color: var(--text-secondary);
}

.incident-card-description {
    margin: 0.75rem 0;
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.incident-card-btn {
    width: 100%;
    padding: 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.incident-card-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.3);
}

.incident-card-btn:active {
    transform: translateY(0);
}

/* Empty state */
.incidents-empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.incidents-empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .incidents-list-btn span,
    .filters-btn span {
        display: none;
    }

    .incidents-list-btn,
    .filters-btn {
        width: 56px;
        height: 56px;
        padding: 0;
        border-radius: 50%;
        justify-content: center;
    }

    .filters-btn {
        left: 20px;
        bottom: 90px;
    }

    .incident-card {
        padding: 1rem;
    }

    .incident-card-title {
        font-size: 1rem;
    }
}

/* Incident Popup Styles */
.maplibregl-popup-content {
    max-height: 500px;
    overflow-y: auto;
    background: #ffffff !important;
}

.incident-popup .maplibregl-popup-content {
    padding: 16px;
}

/* Force all text elements to be black regardless of theme */
.maplibregl-popup-content,
.maplibregl-popup-content h3,
.maplibregl-popup-content p,
.maplibregl-popup-content div,
.maplibregl-popup-content strong,
.maplibregl-popup-content small,
.maplibregl-popup-content span,
.maplibregl-popup-content button {
    color: #333333 !important;
}

.incident-popup h3 {
    text-transform: uppercase !important;
}

.maplibregl-popup-content a {
    color: #2196f3 !important;
}

/* Close button styling */
.maplibregl-popup-close-button {
    font-size: 28px !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    color: #333333 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.maplibregl-popup-close-button:hover {
    background-color: rgba(0, 0, 0, 0.05) !important;
    color: #000000 !important;
}

/* Scrollbar styling for popup */
.maplibregl-popup-content::-webkit-scrollbar {
    width: 6px;
}

.maplibregl-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.maplibregl-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.maplibregl-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ============================================
   BUS LAYER STYLES
   ============================================ */

/* Bus Controls Container */
.bus-controls,
.bus-controls-mobile {
    margin-top: 1rem;
    padding-top: 1rem;
}

.bus-controls h4,
.bus-controls-mobile h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

/* Master Toggle */
.bus-master-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.bus-master-toggle:hover {
    background: var(--hover-background);
    border-color: var(--primary-color);
}

.bus-master-toggle input[type="checkbox"] {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

/* Sub Controls */
.bus-sub-controls {
    padding-left: 1rem;
    border-left: 3px solid var(--primary-color);
    margin-top: 0.75rem;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.bus-sub-controls.hidden {
    opacity: 0.5;
    pointer-events: none;
}

/* Count Badge */
.count-badge {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    margin-left: 0.5rem;
    min-width: 24px;
    text-align: center;
}

/* Bus Popup Styles */
.bus-popup {
    font-family: inherit;
    min-width: 250px;
}

.bus-popup .popup-header {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color);
    color: var(--text-color);
}

.bus-popup .popup-content {
    font-size: 0.95rem;
    line-height: 1.6;
}

.bus-popup .popup-content p {
    margin: 0.5rem 0;
    color: var(--text-color);
}

.bus-popup .popup-content strong {
    color: var(--text-color);
    font-weight: 600;
}

/* Bus Line Filter */
#busLineFilter,
#busLineFilterMobile {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background: var(--card-background);
    color: var(--text-color);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

#busLineFilter:hover,
#busLineFilterMobile:hover {
    border-color: var(--primary-color);
}

#busLineFilter:focus,
#busLineFilterMobile:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Bus line filter options - force black text in dark mode */
html[data-theme="dark"] #busLineFilter option,
html[data-theme="dark"] #busLineFilterMobile option {
    background-color: #ffffff;
    color: #000000;
}

/* Bus info in incident popup */
.nearby-buses {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.nearby-buses h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.nearby-buses ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nearby-buses li {
    padding: 0.5rem;
    margin: 0.25rem 0;
    background: var(--hover-background);
    border-radius: 4px;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nearby-buses .bus-line {
    font-weight: bold;
    color: var(--primary-color);
}

.nearby-buses .bus-distance {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Loading state for buses */
.bus-loading {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem;
    background: var(--hover-background);
    border-radius: 4px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.bus-loading::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .bus-popup {
        min-width: 200px;
        max-width: 280px;
    }

    .count-badge {
        font-size: 0.7rem;
        padding: 0.1rem 0.4rem;
    }
}

/* ============================================
   REFRESH BUTTON
   ============================================ */

.refresh-floating-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #4caf50 0%, #45a049 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.refresh-floating-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.refresh-floating-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.refresh-floating-btn:hover::before {
    opacity: 1;
}

.refresh-floating-btn:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 2px 8px rgba(76, 175, 80, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
}

.refresh-floating-btn svg {
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.refresh-floating-btn:hover svg {
    transform: rotate(180deg);
}

.refresh-floating-btn.refreshing svg {
    animation: spin-refresh 1s linear infinite;
}

@keyframes spin-refresh {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .refresh-floating-btn {
        bottom: 80px;
        left: 16px;
        right: auto;
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   MOBILITY APPS BUTTON
   ============================================ */

.mobility-apps-btn {
    position: fixed;
    z-index: 10;
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.4), 0 2px 8px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.mobility-apps-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.mobility-apps-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5), 0 4px 12px rgba(0, 0, 0, 0.25);
}

.mobility-apps-btn:hover::before {
    opacity: 1;
}

.mobility-apps-btn:active {
    transform: translateY(-1px) scale(1);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Desktop: al lado del botón de refresh */
@media (min-width: 769px) {
    .mobility-apps-btn {
        bottom: 20px;
        right: 88px;
    }
}

/* Mobile: debajo del botón de refresh */
@media (max-width: 768px) {
    .mobility-apps-btn {
        bottom: 16px;
        left: 16px;
        width: 48px;
        height: 48px;
    }
}

/* ============================================
   MOBILITY APPS MODAL
   ============================================ */

.mobility-section {
    margin-bottom: 2rem;
}

.mobility-section:last-child {
    margin-bottom: 0;
}

.mobility-section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mobility-icon {
    font-size: 1.5rem;
}

.mobility-app-card {
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
    overflow: hidden;
}

.mobility-app-card:hover {
    box-shadow: 0 4px 12px var(--shadow-elevation);
    transform: translateY(-2px);
    border-color: var(--primary-color);
}

.mobility-app-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.mobility-app-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobility-app-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobility-app-links {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: linear-gradient(135deg, #1976d2 0%, #1565c0 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-sizing: border-box;
}

.store-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(25, 118, 210, 0.4);
}

.store-badge img {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Scrollbar for modal content */
#mobilityAppsContent::-webkit-scrollbar {
    width: 8px;
}

#mobilityAppsContent::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

#mobilityAppsContent::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

#mobilityAppsContent::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .mobility-app-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .mobility-app-links {
        width: 100%;
        justify-content: stretch;
    }

    .store-badge {
        flex: 1;
        justify-content: center;
    }

    .mobility-section-title {
        font-size: 1.1rem;
    }

    .mobility-app-info h4 {
        font-size: 1rem;
    }

    #mobilityAppsModal .modal-content {
        max-width: 95%;
        margin: 1rem;
    }
}

/* ============================================
   EMERGENCY BUTTON
   ============================================ */

.emergency-btn {
    position: fixed;
    z-index: 10;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    animation: pulse-emergency 2s ease-in-out infinite;
}

.emergency-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.3) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.emergency-btn:hover {
    transform: translateY(-4px) scale(1.08);
    box-shadow: 0 8px 24px rgba(244, 67, 54, 0.6), 0 5px 15px rgba(0, 0, 0, 0.35);
    animation: none;
}

.emergency-btn:hover::before {
    opacity: 1;
}

.emergency-btn:active {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4), 0 2px 6px rgba(0, 0, 0, 0.25);
}

@keyframes pulse-emergency {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5), 0 3px 10px rgba(0, 0, 0, 0.3);
    }
    50% {
        box-shadow: 0 8px 28px rgba(244, 67, 54, 0.7), 0 4px 14px rgba(0, 0, 0, 0.4);
    }
}

/* Desktop: alineado con mobility apps y refresh button */
@media (min-width: 769px) {
    .emergency-btn {
        bottom: 20px;
        right: 156px;
    }
}

/* Mobile: encima del botón de refresh */
@media (max-width: 768px) {
    .emergency-btn {
        bottom: 144px;
        left: 16px;
        width: 52px;
        height: 52px;
    }
}

/* ============================================
   EMERGENCY MODAL
   ============================================ */

/* Botón gigante 911 */
.emergency-911-btn {
    display: block;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(244, 67, 54, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.emergency-911-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.emergency-911-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(244, 67, 54, 0.5);
}

.emergency-911-btn:hover::before {
    left: 100%;
}

.emergency-911-btn:active {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(244, 67, 54, 0.4);
}

.emergency-911-icon {
    margin-bottom: 1rem;
}

.emergency-911-number {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: 0.5rem;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.emergency-911-label {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.emergency-911-desc {
    font-size: 1rem;
    opacity: 0.95;
    font-weight: 500;
}

/* Grid de emergencias */
.emergency-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.emergency-card {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.emergency-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: #f44336;
    transform: scaleY(0);
    transition: transform 0.2s ease;
}

.emergency-card:hover {
    box-shadow: 0 6px 16px var(--shadow-elevation);
    transform: translateY(-3px);
    border-color: #f44336;
}

.emergency-card:hover::before {
    transform: scaleY(1);
}

.emergency-card-icon {
    font-size: 3rem;
    margin-bottom: 0.75rem;
}

.emergency-card-number {
    font-size: 2.5rem;
    font-weight: 900;
    color: #f44336;
    margin-bottom: 0.5rem;
    line-height: 1;
}

.emergency-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.emergency-card-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Cards con múltiples botones */
.emergency-card-dual {
    cursor: default;
}

.emergency-card-dual:hover {
    transform: translateY(-2px);
}

.emergency-card-buttons {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    width: 100%;
    flex-wrap: wrap;
}

.emergency-card-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    text-align: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

.emergency-card-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.4);
}

.emergency-card-btn:active {
    transform: translateY(0);
}

/* Emergency sections */
.emergency-section {
    margin-bottom: 2rem;
}

.emergency-section-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #f44336;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.emergency-icon {
    font-size: 1.6rem;
}

/* Grid pequeño para emergencias móviles privadas */
.emergency-grid-small {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.emergency-card-small {
    background: var(--surface);
    border: 2px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem 1rem;
    text-decoration: none;
    color: var(--text-primary);
    text-align: center;
    transition: all 0.2s ease;
}

.emergency-card-small:hover {
    box-shadow: 0 4px 12px var(--shadow-elevation);
    transform: translateY(-2px);
    border-color: #f44336;
}

.emergency-card-small-number {
    font-size: 1.8rem;
    font-weight: 900;
    color: #f44336;
    margin-bottom: 0.25rem;
}

.emergency-card-small-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Scrollbar para emergency modal */
#emergencyContent::-webkit-scrollbar {
    width: 8px;
}

#emergencyContent::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
    border-radius: 4px;
}

#emergencyContent::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 4px;
}

#emergencyContent::-webkit-scrollbar-thumb:hover {
    background: var(--scrollbar-thumb-hover);
}

/* Mobile responsive para emergency modal */
@media (max-width: 768px) {
    .emergency-911-number {
        font-size: 4rem;
    }

    .emergency-911-label {
        font-size: 1.2rem;
    }

    .emergency-911-desc {
        font-size: 0.9rem;
    }

    .emergency-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .emergency-card {
        padding: 1.25rem;
    }

    .emergency-card-number {
        font-size: 2rem;
    }

    .emergency-card-title {
        font-size: 1rem;
    }

    .emergency-grid-small {
        grid-template-columns: repeat(2, 1fr);
    }

    .emergency-section-title {
        font-size: 1.2rem;
    }

    #emergencyModal .modal-content {
        max-width: 95%;
        margin: 1rem;
    }

    .emergency-card-buttons {
        flex-direction: column;
    }

    .emergency-card-btn {
        width: 100%;
    }
}

/* Loading spinner animation */
@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Validation message styling */
.validation-message {
    display: block;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1) 0%, rgba(220, 38, 38, 0.1) 100%);
    border-left: 4px solid #ef4444;
    border-radius: 6px;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1.5;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
