/* Custom Styles for Maritime Health Atlas */

/* Glassmorphism Panel */
.glass-panel {
    background: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Sidebar/Panel Behavior */
@media (max-width: 768px) {
    .detail-panel-hidden {
        transform: translateY(100%);
    }
    #detail-panel {
        max-height: 80vh;
        border-radius: 24px 24px 0 0;
    }
}

/* Custom Marker Styles (Data Orbs) */
.hospital-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.marker-orb {
    width: 20px;
    height: 20px;
    background: #003f87;
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: relative;
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.marker-orb:hover {
    transform: scale(1.3);
    z-index: 1000;
}

/* Marker Status Colors */
.status-short { background-color: #00843d !important; color: #00843d; }
.status-moderate { background-color: #003f87 !important; color: #003f87; }
.status-long { background-color: #ba1a1a !important; color: #ba1a1a; }

/* Pulse animation for active marker */
@keyframes orb-pulse {
    0% { transform: scale(1); opacity: 0.5; }
    100% { transform: scale(2.8); opacity: 0; }
}

.marker-orb.active::before {
    content: "";
    position: absolute;
    inset: 0;
    background: inherit;
    border-radius: 50%;
    z-index: -1;
    animation: orb-pulse 2s infinite;
}

/* List Item Status Border Colors */
.status-border-short { border-left-color: #00843d !important; }
.status-border-moderate { border-left-color: #003f87 !important; }
.status-border-long { border-left-color: #ba1a1a !important; }

/* Tooltip Styling */
.leaflet-tooltip {
    background: white !important;
    border: none !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    font-family: 'Inter', sans-serif !important;
}

.leaflet-tooltip::before {
    display: none !important;
}

.custom-tooltip .tooltip-name {
    font-weight: 800;
    font-size: 14px;
    color: #003f87;
    margin-bottom: 6px;
    line-height: 1.2;
}

.custom-tooltip .tooltip-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    font-size: 11px;
    color: #424752;
    margin-top: 2px;
}

.custom-tooltip .tooltip-val {
    font-weight: 700;
    color: #191c1e;
}

/* Leaflet Container Background */
.leaflet-container {
    background: #f8f9fb !important;
}

/* Responsive Mobile Overrides & View Toggling */
@media (max-width: 768px) {
    /* Main layout adjustment for mobile view switching */
    .mobile-hidden { display: none !important; }
    
    #hospital-list {
        height: calc(100vh - 160px) !important; /* Ensure list is scrollable */
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    aside {
        width: 100% !important;
        position: absolute;
        top: 0;
        left: 0;
        height: 100%;
        background: #f8f9fb;
        transition: transform 0.3s ease-in-out;
    }

    /* Hide map when list is active on mobile, and vice-versa */
    .view-map #hospital-sidebar { transform: translateX(-100%); }
    .view-list #map { visibility: hidden; pointer-events: none; }
    
    /* FAB Toggle Button */
    .view-toggle-btn {
        position: fixed;
        bottom: 80px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 100;
        box-shadow: 0 8px 24px rgba(0, 63, 135, 0.3);
    }
    
    /* Adjust Legend for mobile to avoid overlap with FAB */
    .glass-panel {
        bottom: 24px !important;
        padding: 8px 16px !important;
        width: 90% !important;
        justify-content: center;
    }
}

/* Enhanced Card Tapability */
#hospital-list > div {
    margin-bottom: 12px;
    padding: 18px 16px !important; /* Larger hit targets */
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.4s ease-out forwards;
}

/* Scrollbar Styling */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #c2c6d4; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #adb1bd; }

/* Add at end of styles.css */
.card-broken {
    opacity: 0.7;
    border-style: dashed !important;
    cursor: not-allowed !important;
    filter: grayscale(0.5);
}

.card-broken:active {
    scale: 1 !important;
}

.badge-slate {
    background-color: #cbd5e1;
    color: #475569;
}

.text-slate {
    color: #64748b;
}

.sync-failed {
    background-color: #fef08a !important; /* Yellow-200 */
    color: #854d0e !important; /* Yellow-900 */
}
