/* ==========================================================================
   DESA KERTAJAYA - CUSTOM STYLES & ACCESSIBILITY ENGINE
   Memenuhi Standar Aksesibilitas WCAG 2.1 AA & Juknis Kemendes PDT
   ========================================================================== */

:root {
    --primary-emerald: var(--color-primary, #059669);
    --primary-dark: var(--color-hero, #064e3b);
    --accent-gold: var(--color-accent, #10b981);
    --accent-gold-light: var(--color-primary-100, #dce6fc);
    --surface-bg: #f8fafc;
    --text-main: #0f172a;
    --font-scale: 1;
}

/* Base Body with dynamic accessibility font scaling */
body {
    font-size: calc(1rem * var(--font-scale));
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* Accessibility: High Contrast Mode */
body.high-contrast {
    background-color: #000000 !important;
    color: #ffffff !important;
}

body.high-contrast .bg-white,
body.high-contrast .bg-slate-50,
body.high-contrast .bg-emerald-50,
body.high-contrast .bg-gray-50,
body.high-contrast .bg-amber-50 {
    background-color: #121212 !important;
    color: #ffff00 !important;
    border-color: #ffff00 !important;
}

body.high-contrast .text-slate-900,
body.high-contrast .text-slate-800,
body.high-contrast .text-slate-700,
body.high-contrast .text-slate-600,
body.high-contrast .text-emerald-900,
body.high-contrast .text-emerald-800 {
    color: #ffffff !important;
}

body.high-contrast a,
body.high-contrast button {
    color: #ffff00 !important;
}

body.high-contrast .btn-emerald {
    background-color: #ffff00 !important;
    color: #000000 !important;
    border: 2px solid #ffffff !important;
}

body.high-contrast .border-slate-200,
body.high-contrast .border-gray-200,
body.high-contrast .border-emerald-100 {
    border-color: #555555 !important;
}

/* Custom Emerald & Gold utility accents */
.bg-emerald-brand {
    background-color: var(--color-primary, #059669) !important;
}

.text-emerald-brand {
    color: var(--color-primary, #059669) !important;
}

.border-emerald-brand {
    border-color: var(--color-primary, #059669) !important;
}

.gold-badge {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

/* Hero Background subtle pattern */
.hero-gradient {
    background: radial-gradient(circle at 20% 20%, var(--color-primary-100, rgba(37, 99, 235, 0.15)) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, var(--color-secondary-100, rgba(79, 70, 229, 0.12)) 0%, transparent 50%),
                linear-gradient(to bottom, var(--color-primary-50, #f8fafc), #ffffff);
}

/* Custom Smooth Transitions */
.card-hover {
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
}

.card-hover:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.08), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
}

/* Custom Leaflet Map Container */
#desaMap {
    height: 420px;
    width: 100%;
    border-radius: 0.75rem;
    z-index: 10;
}

/* TTS Speaking indicator pulse */
.tts-active {
    animation: ttsPulse 1.2s infinite;
}

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

/* Timeline status tracker */
.timeline-step.active .step-icon {
    background-color: var(--color-primary, #059669);
    color: white;
    ring: 4px;
    ring-color: var(--color-primary-200, #c2d3f9);
}

.timeline-step.completed .step-icon {
    background-color: var(--color-accent, #10b981);
    color: white;
}

.timeline-step.pending .step-icon {
    background-color: #e2e8f0;
    color: #64748b;
}

/* Custom Scrollbar for better UI experience */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
