/* Premium Modal Animations */
/* Re-introducing simple pop-in as requested */

.modal-overlay {
    transition: opacity 0.3s ease-out;
    opacity: 0;
}

.modal-overlay.active {
    opacity: 1;
}

.modal-container {
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1); /* slight bounce */
}

.modal-overlay.active .modal-container {
    transform: scale(1);
}

/* Ensure hidden overrides everything */
.hidden {
    display: none !important;
}

/* Custom animations and touch enhancements */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-slow {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.view-section {
    display: none;
    animation: fadeIn 0.3s ease;
}

.view-section.active {
    display: flex;
}

.scan-pulse {
    animation: pulse-slow 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Prevent text selection on touch */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Safe area handling for notched devices */
body {
    padding-bottom: env(safe-area-inset-bottom);
}

/* Nav item active state styling */
.nav-item {
    color: #6B7280;
}

.nav-item.active {
    color: #0EA5E9;
    background-color: #F0F9FF;
}

/* Skeleton Loading Animation */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }

    100% {
        background-position: 1000px 0;
    }
}

.skeleton {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f6f7f8 4%, #edeef1 25%, #f6f7f8 36%);
    background-size: 1000px 100%;
}

/* Toast Notifications */
#toast-container {
    position: fixed;
    bottom: 80px;
    /* Above bottom nav */
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 90%;
    max-width: 400px;
    pointer-events: none;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideInBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: auto;
    border-left: 4px solid #3B82F6;
}

.toast.error {
    border-left-color: #EF4444;
}

.toast.success {
    border-left-color: #10B981;
}

.toast.closing {
    animation: slideOutBottom 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideInBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideOutBottom {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(20px);
    }
}

/* Custom Map Marker (Leaflet) */
.custom-map-marker {
    background: transparent;
    border: none;
}

.custom-marker-pin {
    width: 32px;
    height: 32px;
    border-radius: 50% 50% 50% 0;
    background: #3B82F6;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    box-shadow: 0 3px 5px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

.custom-marker-pin svg {
    transform: rotate(45deg);
    width: 18px;
    height: 18px;
}