/* Custom styles for Twibbon Generator PK LPDP 280 */

/* =========================================================
   Suggestion Dropdown — Nama Awardee Autocomplete
   ========================================================= */
#nama-dropdown {
    scrollbar-width: thin;
    scrollbar-color: #334155 #0f172a;
}
#nama-dropdown::-webkit-scrollbar {
    width: 6px;
}
#nama-dropdown::-webkit-scrollbar-track {
    background: #0f172a;
}
#nama-dropdown::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 3px;
}

.dropdown-item {
    padding: 8px 12px;
    cursor: pointer;
    border-bottom: 1px solid #334155;
    transition: background 0.15s ease;
    color: #e2e8f0;
}
.dropdown-item:last-child {
    border-bottom: none;
}
.dropdown-item:hover,
.dropdown-item.active {
    background: #1e293b;
    color: #ffd45a;
}
.dropdown-item .member-detail {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
}
.dropdown-item:hover .member-detail,
.dropdown-item.active .member-detail {
    color: #cbd5e1;
}

@layer utilities {
    .backdrop-blur-xs {
        backdrop-filter: blur(2px);
    }
}

/* Canvas styling */
#twibbon-canvas {
    touch-action: none; /* Disables browser default scrolling/gestures on canvas */
    background-image: 
        linear-gradient(45deg, #1e293b 25%, transparent 25%), 
        linear-gradient(-45deg, #1e293b 25%, transparent 25%), 
        linear-gradient(45deg, transparent 75%, #1e293b 75%), 
        linear-gradient(-45deg, transparent 75%, #1e293b 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

/* Active dragging cursor indicator */
.is-dragging {
    cursor: grabbing !important;
}

/* Custom Scrollbar for better UI feel */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0f172a;
}

::-webkit-scrollbar-thumb {
    background: #334155;
    border-radius: 4px;
}

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

/* Range input styling */
input[type="range"]::-webkit-slider-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    border: 2px solid #06172e;
}

input[type="range"]::-moz-range-thumb {
    height: 18px;
    width: 18px;
    border-radius: 50%;
    background: #d4af37;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    border: 2px solid #06172e;
}

/* Animation helpers */
@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
    }
    50% {
        box-shadow: 0 0 25px rgba(212, 175, 55, 0.7);
    }
}

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

/* =========================================================
   LGM Editor Styles — 7 Halaman WYSIWYG
   ========================================================= */

/* Stage */
.lgm-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 1080 / 1350;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,.06);
}
.lgm-stage.exporting {
    border-radius: 0 !important;
    overflow: visible !important;
}

/* Text overlay — directly on template, no visible box */
.lgm-text-overlay {
    position: absolute;
    box-sizing: border-box;
    pointer-events: none;
    user-select: none;
    text-align: justify;
}

/* Background image inside stage */
.lgm-stage #lgm-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
    user-select: none;
}

/* Flow Layout Overlay — kept for backwards compatibility but unused */
.lgm-flow-wrap {
    position: absolute;
    left: var(--left-px, 0);
    top: var(--top-px, 0);
    width: var(--w-px, 100%);
    display: grid;
    grid-template-columns: repeat(var(--cols, 2), 1fr);
    gap: var(--gap-px, 16px);
    padding: var(--padY-px, 0) var(--padX-px, 0);
    box-sizing: border-box;
}

/* Absolute Box Overlay — kept for backwards compatibility but unused */
.lgm-overlay-abs {
    position: absolute;
    box-sizing: border-box;
}

/* Generic Box — invisible container, text overlays PNG template directly */
.lgm-box {
    --title-color: #6F3188;
    --body-color: #1f2937;

    display: flex;
    flex-direction: column;
    background: transparent;
    box-shadow: none;
    overflow: hidden;
}

/* Box Title — plain text on template's pre-drawn header */
.lgm-box-title {
    font-family: 'Jost', sans-serif;
    font-weight: 700;
    color: var(--title-color);
    background: transparent;
    padding: 2px 4px;
    line-height: 1.2;
    font-size: inherit;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-shrink: 0;
}

/* Box Body — plain text on template's pre-drawn content area */
.lgm-box-body {
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    color: var(--body-color);
    background: transparent;
    border: none;
    padding: 2px 4px;
    line-height: 1.35;
    overflow: hidden;
    white-space: pre-wrap;
    word-wrap: break-word;
    flex: 1;
}

/* Uniform spacing */
.lgm-flow-wrap .lgm-box {
    margin: 0;
}
.lgm-box-body {
    margin: 0;
    padding-top: calc(var(--body-pad-y) - 2px);
}

/* Print / Export safety */
@media print {
    .lgm-stage {
        box-shadow: none;
        border-radius: 0;
    }
}

/* =========================================================
   Demografi Map Styles
   ========================================================= */

#demografi-map {
    z-index: 1;
}

/* Leaflet popup dark theme override */
.leaflet-popup-content-wrapper {
    background: #0f172a;
    color: #e2e8f0;
    border-radius: 12px;
    border: 1px solid #334155;
    box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.leaflet-popup-tip {
    background: #0f172a;
    border: 1px solid #334155;
}
.leaflet-popup-content {
    margin: 10px 14px;
    font-size: 13px;
    line-height: 1.5;
}
.leaflet-container a.leaflet-popup-close-button {
    color: #94a3b8;
    padding: 6px 8px 0 0;
}
.leaflet-container a.leaflet-popup-close-button:hover {
    color: #e2e8f0;
}
