/**
 * Abandoned Waste Management System - Core Application Stylesheet
 * Pre-compiled, CSP-hardened styles (eliminates inline styles for strict CSP)
 */

@charset "UTF-8";

/* 1. Global Typography & Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Kanit', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* 2. Micro-interactions & Fluid Elements */
button, a {
    -webkit-tap-highlight-color: transparent;
}

.btn-fluid, button[type="submit"] {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-fluid:active, button[type="submit"]:active {
    transform: scale(0.98);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* 3. Anti-Spam Bot Honeypot Field (Zero Inline Style) */
.form-honeypot {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
    pointer-events: none !important;
}

/* 4. Leaflet Map Controls & Containment */
.leaflet-container {
    z-index: 1 !important;
}

.leaflet-pane {
    z-index: 1 !important;
}

.leaflet-top, .leaflet-bottom {
    z-index: 10 !important;
}

/* 5. Sleek Modal Scrollbar */
.modal-body-scroll {
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}
.modal-body-scroll::-webkit-scrollbar {
    width: 6px;
}
.modal-body-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.modal-body-scroll::-webkit-scrollbar-thumb {
    background-color: #cbd5e1;
    border-radius: 9999px;
}
.modal-body-scroll::-webkit-scrollbar-thumb:hover {
    background-color: #94a3b8;
}

/* 6. Anti-Glitch & Native Picker Styling (Eliminates Black Flash in Chromium/Windows) */
:root, html, body {
    color-scheme: light;
}

input[type="date"],
input[type="time"],
input[type="datetime-local"],
select {
    color-scheme: light !important;
}

input[type="date"] {
    accent-color: #059669 !important;
    background-color: #f8fafc !important;
    transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

input[type="date"]:focus {
    background-color: #ffffff !important;
}

input[type="date"]::-webkit-datetime-edit,
input[type="date"]::-webkit-datetime-edit-fields-wrapper,
input[type="date"]::-webkit-datetime-edit-text,
input[type="date"]::-webkit-datetime-edit-month-field,
input[type="date"]::-webkit-datetime-edit-day-field,
input[type="date"]::-webkit-datetime-edit-year-field {
    transition: none !important;
}

input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.65;
    padding: 2px;
}

input[type="date"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

.modal-backdrop-solid {
    background-color: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* 7. Thai In-DOM Datepicker (Zero Black Flash, Guaranteed 7-Column Grid) */
.thai-datepicker-popover {
    width: 290px !important;
    max-width: calc(100vw - 32px) !important;
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 18px !important;
    box-shadow: 0 12px 30px -4px rgba(15, 23, 42, 0.16), 0 4px 10px -2px rgba(15, 23, 42, 0.08) !important;
    padding: 12px !important;
    z-index: 60 !important;
}

.thai-datepicker-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 3px !important;
    text-align: center !important;
    width: 100% !important;
}

.thai-datepicker-grid .day-name {
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    padding: 4px 0 !important;
    text-align: center !important;
}

.thai-datepicker-grid .day-name.sunday {
    color: #e11d48 !important;
}

.thai-datepicker-grid .day-cell {
    height: 34px !important;
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 12px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    border: none !important;
    background: transparent;
    color: #1e293b;
    cursor: pointer;
    transition: background-color 0.12s, color 0.12s;
    user-select: none !important;
}

.thai-datepicker-grid .day-cell:hover {
    background-color: #ecfdf5 !important;
    color: #065f46 !important;
}

.thai-datepicker-grid .day-cell.selected {
    background-color: #059669 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
    box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35) !important;
}

.thai-datepicker-grid .day-cell.today {
    border: 1.5px solid #059669 !important;
    color: #047857 !important;
    font-weight: 700 !important;
}

.thai-datepicker-grid .day-cell.muted {
    color: #cbd5e1 !important;
    pointer-events: none !important;
    cursor: default !important;
}

/* Custom Leaflet Map Pin Markers */
.map-marker-pin {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-marker-pin-sm {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-marker-dot {
    background-color: white;
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.pin-amber { background-color: #f59e0b !important; }
.pin-emerald { background-color: #10b981 !important; }
.pin-blue { background-color: #3b82f6 !important; }
.pin-slate { background-color: #64748b !important; }
.pin-rose { background-color: #ef4444 !important; }


/* Custom Leaflet Popup Cards */
.map-popup-card {
    font-family: 'Kanit', sans-serif;
    min-width: 200px;
    padding: 4px;
}

.map-popup-title {
    font-weight: bold;
    font-size: 14px;
    color: #0f172a;
    margin-bottom: 4px;
}

.map-popup-type {
    font-size: 12px;
    color: #059669;
    font-weight: 500;
    margin-bottom: 4px;
}

.map-popup-addr {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 6px;
}

.map-popup-meta {
    font-size: 11px;
    color: #334155;
    margin-bottom: 6px;
}

.map-popup-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: bold;
    background: #ecfdf5;
    color: #065f46;
    margin-bottom: 8px;
}

.map-popup-divider {
    border-top: 1px solid #e2e8f0;
    padding-top: 6px;
}

.map-popup-link,
.leaflet-popup-content a.map-popup-link,
.leaflet-container a.map-popup-link {
    display: block !important;
    text-align: center !important;
    padding: 6px 12px !important;
    background: #059669 !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: background 0.15s ease !important;
}

.map-popup-link:hover,
.map-popup-link:focus,
.map-popup-link:active,
.map-popup-link:visited,
.leaflet-popup-content a.map-popup-link:hover,
.leaflet-popup-content a.map-popup-link:visited,
.leaflet-container a.map-popup-link:hover,
.leaflet-container a.map-popup-link:visited {
    background: #047857 !important;
    color: #ffffff !important;
}

.map-popup-link-dark,
.leaflet-popup-content a.map-popup-link-dark,
.leaflet-container a.map-popup-link-dark {
    display: block !important;
    text-align: center !important;
    padding: 6px 12px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    font-size: 11px !important;
    text-decoration: none !important;
    font-weight: 700 !important;
    transition: background 0.15s ease !important;
}

.map-popup-link-dark:hover,
.map-popup-link-dark:focus,
.map-popup-link-dark:active,
.map-popup-link-dark:visited,
.leaflet-popup-content a.map-popup-link-dark:hover,
.leaflet-popup-content a.map-popup-link-dark:visited,
.leaflet-container a.map-popup-link-dark:hover,
.leaflet-container a.map-popup-link-dark:visited {
    background: #1e293b !important;
    color: #ffffff !important;
}

/* 5. Fluid Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

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

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

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

/* Dark theme scrollbar for Admin */
.admin-layout ::-webkit-scrollbar-track {
    background: #0f172a;
}

.admin-layout ::-webkit-scrollbar-thumb {
    background: #334155;
}

.admin-layout ::-webkit-scrollbar-thumb:hover {
    background: #475569;
}
