/* ==============================================================================
   PORTAL KAMPUNG GUGUNG SORIK - MODERN DESIGN SYSTEM & POLISH
   ============================================================================== */

:root {
    color-scheme: light;
    --portal-green: #047857;
    --portal-green-dark: #064e3b;
    --portal-surface: #ffffff;
    --portal-border: #e5e7eb;
    --portal-shadow: 0 8px 24px rgba(28, 45, 37, 0.06);
}

html {
    scroll-padding-top: 5rem;
}

body {
    background:
        radial-gradient(ellipse at 50% 0, rgba(209, 250, 229, 0.34), transparent 34rem),
        #f5f6f3;
}

.site-header-inner,
.portal-main,
.site-footer-content,
.site-footer-meta {
    max-width: 1680px;
    margin-inline: auto;
}

.portal-main {
    width: 100%;
}

.site-header-inner {
    width: 100%;
}

.site-footer-content,
.site-footer-meta {
    width: 100%;
}

main .bg-white.border.border-stone-200.rounded-2xl {
    border-color: var(--portal-border);
    box-shadow: var(--portal-shadow);
}

main .gallery-card,
main .hover-lift {
    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease;
}

main .gallery-card:hover,
main .hover-lift:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 30px rgba(28, 45, 37, 0.12);
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(16, 185, 129, 0.55);
    outline-offset: 2px;
}

.mobile-bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
    background-color: rgba(15, 23, 42, 0.97);
    box-shadow: 0 12px 36px rgba(15, 23, 42, 0.24);
}

.village-map {
    z-index: 0;
}

/* Custom House Pin Marker on Leaflet */
.village-home-marker {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
}

.village-home-pin-wrapper {
    position: relative;
    width: 54px;
    height: 54px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.village-home-pulse {
    position: absolute;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: rgba(4, 120, 87, 0.45);
    animation: markerPulse 2.2s infinite ease-out;
}

.village-home-pin {
    position: relative;
    z-index: 2;
    width: 44px;
    height: 44px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: linear-gradient(135deg, #10b981 0%, #047857 100%);
    border: 3px solid #ffffff;
    box-shadow: 0 12px 28px -3px rgba(0, 0, 0, 0.4), 0 4px 8px -2px rgba(4, 120, 87, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    cursor: pointer;
}

.village-home-pin:hover {
    transform: rotate(-45deg) scale(1.15);
    box-shadow: 0 16px 32px -4px rgba(0, 0, 0, 0.45), 0 6px 14px -2px rgba(4, 120, 87, 0.4);
}

.village-home-pin svg {
    transform: rotate(45deg);
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
}

@keyframes markerPulse {
    0% {
        transform: scale(0.5);
        opacity: 0.95;
    }
    100% {
        transform: scale(1.9);
        opacity: 0;
    }
}

/* Custom Leaflet Popup Styling */
.village-leaflet-popup .leaflet-popup-content-wrapper {
    padding: 0;
    border-radius: 20px;
    box-shadow: 0 20px 35px -5px rgba(0, 0, 0, 0.25), 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(226, 232, 240, 0.9);
    overflow: hidden;
}

.village-leaflet-popup .leaflet-popup-content {
    margin: 0;
    line-height: inherit;
}

.village-leaflet-popup .leaflet-popup-tip {
    background: #ffffff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.leaflet-container {
    font: inherit;
}

/* Custom Sleek Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #a7f3d0;
    border-radius: 9999px;
    border: 2px solid #f1f5f9;
}

::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* Animations & Transitions */
@keyframes pulseGlow {
    0%, 100% {
        opacity: 0.85;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02);
    }
}

.animate-pulse-glow {
    animation: pulseGlow 3s infinite ease-in-out;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.animate-modal-in {
    animation: fadeInScale 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Glassmorphism Classes */
.glass-panel {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.glass-dark {
    background: rgba(15, 23, 42, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

/* Card Hover Elevation */
.hover-lift {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.hover-lift:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -6px rgba(6, 78, 59, 0.12), 0 4px 10px -2px rgba(0, 0, 0, 0.04);
}

/* Running Ticker Himbauan Kampung */
.ticker-container {
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    width: 100%;
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 32s linear infinite;
    padding-left: 100%;
}

.ticker-content:hover {
    animation-play-state: paused;
}

@keyframes ticker-scroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}

/* Safe Area Inset for Modern Android & iOS */
.safe-bottom-nav {
    padding-bottom: max(0.5rem, env(safe-area-inset-bottom));
}

@media (max-width: 639px) {
    .site-brand-copy > p {
        display: none;
    }

    .site-brand-copy h1 {
        font-size: 0.95rem;
    }

    .portal-main {
        padding-top: 1.25rem;
    }

    .mobile-bottom-nav {
        bottom: max(0.75rem, env(safe-area-inset-bottom));
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Stylesheet untuk Bukti Pengaduan Warga */
@media print {
    body * {
        visibility: hidden;
    }
    #printable-complaint, #printable-complaint * {
        visibility: visible;
    }
    #printable-complaint {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        padding: 24px;
        background: white !important;
        color: black !important;
        border: 2px solid #064e3b;
        border-radius: 8px;
    }
    .no-print {
        display: none !important;
    }
}
