/* ==========================================================================
   1. ROOT VARIABLES & GLOBAL STYLES
   ========================================================================== */

:root {
    --font-heading: "Montserrat", sans-serif;
    --font-text: "Poppins", sans-serif;
    --font-tertiary: "Open Sans", sans-serif;
    --color-primary: #f48221;
    --color-secondary: #f48221;
    --color-aksen: #bb1716;
    --color-netral: #333333;
    --color-purewhite: #ffff;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    background-color: var(--color-purewhite);
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

/* ==========================================================================
   2. LAYOUT & CORE WRAPPERS
   ========================================================================== */

main,
section,
.wrapper-layanan,
.wrapper-tentangkami,
.wrapper-programpilihan,
.donasi,
.wrapper-berita,
.heroSwiper,
.container-layanan {
    overflow-x: hidden;
    max-width: 100%;
}

h1,
h2,
h3,
p {
    font-family: var(--font-heading);
}

.line {
    margin-top: 5em;
    margin-bottom: 5em;
}

.wrapper-layanan h1,
.right-tentangkami h1,
.wrapper-penampilan h1,
.wrapper-programpilihan h1,
.donasi h1,
.wrapper-berita h1 {
    margin: 0;
    font-size: 5em;
    font-weight: 600;
}

/* ==========================================================================
   3. UTILITIES & ACCESSIBILITY
   ========================================================================== */

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

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

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

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

/* Tabular Nums for Currency */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid #bb1716;
    outline-offset: 2px;
}

/* UI Elements & Decorative Patterns */
.wave-bg {
    background-color: #f58220;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0 Q45 15 30 30 Q15 45 30 60 Q45 45 60 30 Q45 15 30 0Z' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
}

.divider-dots {
    background-image: radial-gradient(circle, #e5e7eb 1px, transparent 1px);
    background-size: 8px 1px;
    height: 1px;
    margin: 10px 0;
}

input[type="radio"] {
    accent-color: #bb1716;
}

input[name="kategori"]:checked + div {
    border-color: #f58220 !important;
    background-color: #fff7ed !important;
    color: #f58220 !important;
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
}

/* ==========================================================================
   4. NAVIGATION COMPONENT
   ========================================================================== */

/* Scroll Behavior */
.nav-scrolled #nav-bg {
    background-color: rgba(244, 130, 33, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(244, 130, 33, 0.15);
}

.nav-scrolled {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}

/* Mobile Menu States */
#mobile-menu.active {
    opacity: 1 !important;
    transform: scale(1) !important;
    pointer-events: auto !important;
    visibility: visible !important;
}

/* Hamburger Animation */
#hamburger-btn.active #menu-icon {
    transform: rotate(90deg);
}

/* ==========================================================================
   5. AUTH PAGE COMPONENT
   ========================================================================== */

.container-auth {
    background-color: var(--color-purewhite);
    display: flex;
    width: 100%;
    justify-content: center;
    align-items: center;
}

/* ==========================================================================
   8. HERO SWIPER STYLES
   ========================================================================== */

.heroSwiper .swiper-pagination .swiper-pagination-bullet {
    pointer-events: auto !important;
    margin: 0 !important;
}

.swiper-pagination-bullet {
    background-color: rgba(255, 255, 255, 0.4);
    width: 10px;
    height: 10px;
    border-radius: 999px;
    transition: all 0.4s ease;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    width: 32px;
    background-color: #ffb81c;
}

/* ==========================================================================
   9. CAMPAIGN / DONATION UTILITIES
   ========================================================================== */

.line-clamp-2 {
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Progress Bar Base Base */
.progress-bar-base {
    height: 100%;
    border-radius: 999px;
    position: relative;
    overflow: hidden;
    transition: width 1s ease-out;
}

.progress-bar-fill {
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, #f48221, #feb81c);
    border-radius: 999px;
}

.progress-bar-shimmer {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer 2s infinite;
}

/* Donation Card Filter Animation States */
.donation-card-init {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.donation-card-visible {
    opacity: 1;
    transform: translateY(0);
}

.donation-card-hiding {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Interactive Components */
#donation-count.changing {
    animation: numberPop 0.3s ease-out;
}

/* ==========================================================================
   10. NEWS COMPONENT (BERITA)
   ========================================================================== */

.mySwiper-berita-top,
.mySwiper-berita-bottom {
    margin-bottom: 5em;
}

.wrapper-berita {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 35vh;
}

.wrapper-berita h1 {
    margin: 0;
    background: linear-gradient(to right, #f48221, #feb81c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

.wrapper-berita p {
    max-width: 30em;
    width: 100%;
    text-align: center;
}

.slide-berita {
    display: block;
}

/* Berita Card Layout */
.card-berita {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 920px;
    height: 180px;
    background: #ffffff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
}

.card-image-berita {
    width: 170px;
    height: 100%;
    background: #e6e6e6;
    position: relative;
    flex-shrink: 0;
}

.card-image-berita img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-content-berita {
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    font-weight: 600;
    z-index: 2;
}

.card-title-berita {
    font-size: 0.8em;
    font-weight: 600;
}

.price-berita {
    font-size: 12px;
    color: #666;
}

.card-excerpt-berita {
    font-size: 14px;
    color: #444;
    position: absolute;
    bottom: 0;
}

/* ==========================================================================
   11. LIKE BUTTON INTERACTIVE ANIMATIONS
   ========================================================================== */

#like-button.is-liked #like-icon {
    animation: heartPop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#like-button.is-liked .bi-heart::before {
    content: "\f415";
    font-weight: 600;
}

#like-button:not(.is-liked):hover {
    animation: softPulse 2s infinite;
}

/* Particle Triggers */
#like-button.is-liked .particle:nth-child(1) {
    animation: particle-1 0.6s ease-out forwards;
}
#like-button.is-liked .particle:nth-child(2) {
    animation: particle-2 0.6s ease-out forwards 0.05s;
}
#like-button.is-liked .particle:nth-child(3) {
    animation: particle-3 0.6s ease-out forwards 0.1s;
}
#like-button.is-liked .particle:nth-child(4) {
    animation: particle-4 0.6s ease-out forwards 0.05s;
}
#like-button.is-liked .particle:nth-child(5) {
    animation: particle-5 0.6s ease-out forwards 0.15s;
}
#like-button.is-liked .particle:nth-child(6) {
    animation: particle-6 0.6s ease-out forwards 0.1s;
}

/* ==========================================================================
   12. GLOBAL CORE ANIMATIONS KEYFRAMES
   ========================================================================== */

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

.animate-shimmer {
    animation: shimmer 2s infinite;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

@keyframes pulse-slow {
    0%,
    100% {
        opacity: 0.5;
        transform: scale(1);
    }
    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}

.animate-pulse-slow {
    animation: pulse-slow 8s ease-in-out infinite;
}

@keyframes heartPop {
    0% {
        transform: scale(1);
    }
    25% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes softPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.2);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(249, 115, 22, 0);
    }
}

@keyframes numberPop {
    0% {
        transform: translateY(0);
        opacity: 1;
    }
    50% {
        transform: translateY(-4px);
        opacity: 0.7;
    }
    100% {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Particle Vectors Keyframes */
@keyframes particle-1 {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-12px, -12px) scale(0);
    }
}
@keyframes particle-2 {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(12px, -8px) scale(0);
    }
}
@keyframes particle-3 {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-8px, 10px) scale(0);
    }
}
@keyframes particle-4 {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(10px, 12px) scale(0);
    }
}
@keyframes particle-5 {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(0, -14px) scale(0);
    }
}
@keyframes particle-6 {
    0% {
        opacity: 1;
        transform: translate(0, 0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translate(-14px, 0) scale(0);
    }
}

/* ==========================================================================
   13. MEDIA QUERIES (RESPONSIVE STYLES)
   ========================================================================== */

/* --- Screen Reduced Motion Accessibility --- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* --- Tablet Breakpoint (max-width: 1024px) --- */
@media (max-width: 1024px) {
    .slide-berita {
        height: 10em !important;
    }

    .card-berita {
        height: 160px !important;
    }

    .card-image-berita {
        width: 150px !important;
    }

    .card-title-berita {
        font-size: 14px;
    }

    .card-excerpt-berita {
        font-size: 13px;
        position: relative !important;
        bottom: auto !important;
        margin-top: auto;
    }

    .wrapper-berita {
        min-width: 10vh;
        min-height: 20vh;
    }

    .mySwiper-berita-top .swiper-wrapper,
    .mySwiper-berita-bottom .swiper-wrapper {
        display: flex !important;
    }

    .mySwiper-berita-top .swiper-slide,
    .mySwiper-berita-bottom .swiper-slide {
        width: 80% !important;
    }
}

/* --- Mobile Breakpoint (max-width: 767px) --- */
@media (max-width: 767px) {
    *,
    *::before,
    *::after {
        box-sizing: border-box;
    }

    .mySwiper-berita-top .swiper-wrapper,
    .mySwiper-berita-bottom .swiper-wrapper {
        display: flex !important;
        flex-direction: column;
        height: 220vh;
        gap: 8em;
    }

    .swiper-slide {
        width: 100% !important;
        flex-shrink: 0;
        height: 10em !important;
    }

    .mySwiper-berita-top .swiper-slide,
    .mySwiper-berita-bottom .swiper-slide {
        width: 100% !important;
    }

    .section-berita {
        padding: 30px 0;
        overflow-x: hidden;
    }

    .wrapper-berita {
        padding: 0 15px;
        min-height: auto;
        margin-bottom: 20px;
    }

    .wrapper-berita h1 {
        font-size: 2.2em !important;
        line-height: 1.2;
    }

    .wrapper-berita p {
        width: 100% !important;
        font-size: 14px !important;
        padding: 0 5px;
        margin-top: 8px;
    }

    .mySwiper-berita-top,
    .mySwiper-berita-bottom {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 15px;
        margin-bottom: 20px;
        padding: 0 15px;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .slide-berita {
        padding: 0;
    }

    .card-berita {
        width: 100% !important;
        max-width: 100%;
        height: auto !important;
        min-height: auto;
        flex-direction: column !important;
        border-radius: 10px;
        overflow: hidden;
    }

    .card-image-berita {
        width: 100% !important;
        height: 150px !important;
        position: relative;
    }

    .card-badge {
        position: absolute;
        top: 10px;
        left: 10px;
        background: rgba(255, 255, 255, 0.95);
        color: #333;
        font-size: 10px !important;
        padding: 4px 10px !important;
        border-radius: 4px;
        font-weight: 600;
        z-index: 2;
    }

    .card-content-berita {
        padding: 12px 15px !important;
        width: 100%;
    }

    .card-title-berita {
        font-size: 14px !important;
        line-height: 1.4;
        margin: 0 0 8px 0;
    }

    .card-excerpt-berita {
        font-size: 12px !important;
        position: relative !important;
        bottom: auto !important;
        margin: 0;
    }
}

/* --- Tiny Mobile Breakpoint (max-width: 480px) --- */
@media (max-width: 480px) {
    .wrapper-layanan h1,
    .right-tentangkami h1,
    .wrapper-penampilan h1,
    .wrapper-programpilihan h1,
    .donasi h1,
    .wrapper-berita h1 {
        font-size: 2.4em;
    }
}

/* ==========================================================================
   Blob Shapes for Decorative Backgrounds
   ========================================================================== */
.blob-shape {
    border-radius: 60% 40% 30% 70% / 60% 30% 70% 40%;
}
.blob-shape-2 {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}

/* ==========================================================================
   Shimmer & Stat Card Effects (Laporan Publik)
   ========================================================================== */
.shimmer-effect::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.stat-line-effect::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f58220, #ffb81c);
    transform: scaleX(0);
    transition: transform 0.4s ease;
    transform-origin: left;
}
.stat-line-effect:hover::before {
    transform: scaleX(1);
}

.campaign-side-effect::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(180deg, #f58220, #ffb81c);
    transform: scaleY(0);
    transition: transform 0.4s ease;
    transform-origin: top;
}
.campaign-side-effect:hover::before {
    transform: scaleY(1);
}
