/**
 * Bird of Prey Watch UK - Main Stylesheet
 * File: httpdocs/assets/css/app.css
 */

/* ==========================================================================
   1. Base & Reset Adjustments
   ========================================================================== */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* Smooth scrolling for page anchors */
html {
    scroll-behavior: smooth;
}

/* ==========================================================================
   2. Map Viewport & Container
   ========================================================================== */
#map {
    height: calc(100vh - 64px);
    min-height: 480px;
    width: 100%;
    background-color: #e2e8f0;
}

@media (max-width: 768px) {
    #map {
        height: calc(100vh - 56px);
    }
}

/* Prevent text highlight on interactive map cards */
.no-select {
    user-select: none;
    -webkit-user-select: none;
}

/* ==========================================================================
   3. Google Maps Custom InfoWindow Styles
   ========================================================================== */
/* Outer card rounding and shadow */
.gm-style .gm-style-iw-c {
    padding: 14px 16px !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 25px -5px rgba(15, 23, 42, 0.18), 0 8px 10px -6px rgba(15, 23, 42, 0.1) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
    max-width: 320px !important;
    font-family: inherit !important;
}

/* Inner content area overflow and text layout */
.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: 280px !important;
    padding: 0 !important;
}

/* Custom styled close button */
.gm-style .gm-ui-hover-effect {
    top: 6px !important;
    right: 6px !important;
    border-radius: 9999px !important;
    opacity: 0.6;
    transition: opacity 0.15s ease, background-color 0.15s ease;
}

.gm-style .gm-ui-hover-effect:hover {
    opacity: 1;
    background-color: #f1f5f9 !important;
}

/* InfoWindow content elements */
.map-popup h3 {
    letter-spacing: -0.015em;
}

.map-popup p {
    margin: 3px 0;
    line-height: 1.45;
}

/* ==========================================================================
   4. Modals & Form Overlays
   ========================================================================== */
/* Lock body scroll when modal is active */
body.modal-open {
    overflow: hidden;
}

/* Custom backdrop blur animation */
#log-modal, #authModal {
    animation: fadeInModal 0.18s ease-out forwards;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Ensure mobile keyboard does not obscure modal submission buttons */
@media (max-width: 640px) {
    #log-modal > div,
    #authModal > div {
        max-height: 92vh;
        margin-top: auto;
        margin-bottom: 0;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}

/* ==========================================================================
   5. Form Inputs & Number Spinners
   ========================================================================== */
/* Clean styling for datetime and numeric inputs */
input[type="datetime-local"],
input[type="number"],
input[type="text"],
input[type="email"],
input[type="password"],
select,
textarea {
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #059669;
    box-shadow: 0 0 0 3px rgba(5, 150, 105, 0.15);
}

/* Hide standard arrows on number inputs if desired */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    opacity: 0.8;
}

/* ==========================================================================
   6. Custom Scrollbars (Popups and Tables)
   ========================================================================== */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: #f8fafc;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   7. Species Status Badges & Pin Hover Effects
   ========================================================================== */
.species-card-icon {
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.group:hover .species-card-icon {
    transform: scale(1.08);
}

/* Coordinate indicator pulse */
.location-live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    animation: livePulse 2s infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 7px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}