@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap");

body {
    font-family: "Poppins", sans-serif;
    background-color: #f8f9fa;
    overflow-x: hidden;
}

/* --- WARNA UTAMA --- */
:root {
    --color-primary: #00c897;
    --color-secondary: #102a43;
    --color-accent: #00bfa6;
}

.text-navy {
    color: var(--color-secondary);
}
.bg-navy {
    background-color: var(--color-secondary);
}
.text-green-custom {
    color: var(--color-primary);
}
.bg-green-custom {
    background-color: var(--color-primary);
}

/* --- NAVBAR --- */
.navbar {
    background-color: #00bfa6;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}
.btn-profile {
    background: white;
    color: #00bfa6;
    border-radius: 50px;
    padding: 5px 20px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}
.btn-profile:hover {
    background: #f0f0f0;
    color: #008f7a;
}
/* Logo Box */
.logo-box {
    width: 125px;
    height: 50px;
    background: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.logo-box img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* --- HERO SECTION --- */
.hero-section {
    background:
        linear-gradient(rgba(0, 50, 80, 0.6), rgba(0, 50, 80, 0.6)),
        url("../img/hero.avif");
    background-size: cover;
    background-position: center;
    height: 600px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: -50px;
}

/* --- LEADERBOARD --- */
.card-leaderboard {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s;
}
.card-leaderboard:hover {
    transform: translateY(-10px);
}
.avatar-circle {
    width: 80px;
    height: 80px;
    background-color: #e3f2fd;
    color: #1565c0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 15px;
}

/* --- TOMBOL CTA --- */
.btn-cta {
    background-color: var(--color-primary);
    color: white;
    border-radius: 50px;
    padding: 12px 40px;
    font-weight: bold;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 200, 151, 0.4);
    transition: 0.3s;
}
.btn-cta:hover {
    background-color: #00a07b;
    color: white;
}

/* --- DAMPAK SECTION --- */
.section-dampak {
    background-color: #00c897;
    padding: 80px 0;
    color: white;
    position: relative;
}
.badge-title {
    background-color: #102a43 !important;
    color: white !important;
    padding: 15px 40px;
    border-radius: 50px;
    display: inline-block;
    font-weight: 800;
    margin-bottom: 50px;
    font-size: 1.1rem;
    letter-spacing: 1px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
    position: relative;
    z-index: 5;
}
@media (min-width: 992px) {
    .badge-title {
        margin-left: -12px;
        padding-left: 30px;
    }
}
.img-dampak {
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 50, 40, 0.4);
    width: 100%;
    height: 500px;
    object-fit: cover;
}

/* Carousel Controls */
.carousel-control-prev,
.carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: rgba(16, 42, 67, 0.4);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    opacity: 1;
    transition: all 0.3s;
    z-index: 10;
}
.carousel-control-prev {
    left: -10%;
}
.carousel-control-next {
    right: -10%;
}
.carousel-control-prev:hover,
.carousel-control-next:hover {
    background-color: #102a43;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
}
.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 20px;
    height: 20px;
}
.carousel-indicators {
    bottom: -60px;
}
.carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.4);
    border: none;
    margin: 0 6px;
}
.carousel-indicators .active {
    background-color: white;
    transform: scale(1.3);
}

/* --- JENIS PLASTIK (CARD) --- */
.card-plastic-item {
    position: relative;
    height: 500px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
    cursor: pointer;
    background-color: #f0f0f0;
}
.card-plastic-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 200, 151, 0.25);
}
.card-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}
.card-plastic-item:hover .card-bg-img {
    transform: scale(1.1);
}

/* Overlay Content */
/* Update Bagian Overlay agar Tinggi Rata */
.plastic-content-overlay {
    position: absolute;
    bottom: 15px;
    left: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 15px; /* Padding sedikit disesuaikan */
    text-align: center;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(4px);

    /* --- PERUBAHAN UTAMA DISINI --- */
    height: 280px; /* 1. KUNCI TINGGI FIX (Sesuaikan jika teks kepotong, misal 300px) */

    /* 2. Agar konten teks selalu di tengah vertikal */
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    /* 3. Jaga-jaga kalau teks kepanjangan banget */
    overflow: hidden;
}
.plastic-content-overlay h6 {
    font-size: 1rem;
    margin-bottom: 8px;
}
.plastic-content-overlay small {
    font-size: 0.75rem !important;
    font-weight: 500;
    opacity: 0.8;
    line-height: 1.4;
    display: block;
}
/* ICON RESIN (Kecil di Desktop) */
.recycle-icon img {
    width: 35px; /* Icon segitiga resin dibuat kecil */
    height: auto;
    margin-bottom: 5px;
}
.link-detail-small {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 8px;
    display: inline-block;
}

/* --- MODAL OVERLAY --- */
.modal-content {
    border-radius: 25px;
    border: none;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}
.modal-header {
    background: white;
    border-bottom: none;
    padding: 20px 30px;
    z-index: 10;
    position: relative;
}
.modal-body {
    padding: 0 !important;
}
.modal-img-wrapper {
    width: 100%;
    height: 100%;
    padding: 20px;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-img-full {
    width: 100%;
    height: 700px;
    object-fit: cover;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}
.modal-text-content {
    padding: 20px 40px 40px 0;
    background: white;
    height: 100%;
    overflow-y: auto;
}
.tips-box {
    background-color: #ecfdf5;
    border-left: 5px solid var(--color-primary);
    padding: 20px;
    margin-top: 25px;
    border-radius: 12px;
    font-size: 0.95rem;
    color: #064e3b;
    box-shadow: 0 5px 15px rgba(0, 200, 151, 0.1);
}

/* --- FOOTER --- */
footer {
    background-color: var(--color-secondary);
    color: white;
    padding: 60px 0 20px;
}
footer a {
    color: #ccc;
    text-decoration: none;
}
footer a:hover {
    color: white;
}

/* =========================================
   HALAMAN AUTH (LOGIN & REGISTER)
   ========================================= */
.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    /* Background gradien hijau sangat muda */
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2f1 100%);
    padding: 40px 0;
}

.auth-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.05);
    background-color: white;
    padding: 40px;
}

.auth-logo {
    max-width: 150px;
    margin-bottom: 20px;
}

.form-control-custom {
    border-radius: 12px;
    padding: 12px 18px;
    border: 1px solid #e2e8f0;
    font-size: 0.95rem;
    transition: all 0.3s;
    background-color: #f8f9fa;
}

.form-control-custom:focus {
    border-color: var(--color-primary);
    background-color: white;
    box-shadow: 0 0 0 4px rgba(0, 200, 151, 0.15);
}

.form-label-custom {
    font-weight: 600;
    color: var(--color-secondary);
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.btn-auth {
    background-color: var(--color-primary);
    color: white;
    border-radius: 12px;
    padding: 14px;
    font-weight: bold;
    border: none;
    width: 100%;
    transition: 0.3s;
    font-size: 1rem;
    margin-top: 10px;
}

.btn-auth:hover {
    background-color: #00a07b;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 15px rgba(0, 200, 151, 0.25);
}

.auth-link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    transition: 0.3s;
}

.auth-link:hover {
    color: var(--color-secondary);
}
/* ========================================= */
/* CSS KHUSUS SECTION EDUKASI 10R            */
/* ========================================= */
.scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;

    /* Efek meluncur (momentum) yang mulus banget di HP/Touchpad */
    -webkit-overflow-scrolling: touch;

    /* HAPUS scroll-snap-type biar gak ada efek patah/nahan */
    /* scroll-snap-type: x proximity; <-- INI DIHAPUS */
    /* scroll-behavior: smooth; <-- INI JUGA DIHAPUS biar geser manual lebih responsif */

    padding-bottom: 1.5rem;
    padding-top: 0.5rem;
    cursor: grab;
}

.scroll-card {
    flex: 0 0 auto;
    width: 260px;
    margin-right: 1.25rem;

    /* HAPUS scroll-snap-align */
    /* scroll-snap-align: center; <-- INI DIHAPUS */

    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;

    /* Tetap pertahankan Hardware Acceleration biar 60fps */
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
    will-change: transform;
}

/* Sembunyikan scrollbar DI HP saja */
@media (max-width: 768px) {
    .scroll-container {
        scrollbar-width: none;
    }
    .scroll-container::-webkit-scrollbar {
        display: none;
    }
}

/* Tampilkan scrollbar tipis nan cantik DI PC */
@media (min-width: 769px) {
    .scroll-container::-webkit-scrollbar {
        height: 8px; /* Ketebalan scrollbar */
    }
    .scroll-container::-webkit-scrollbar-track {
        background: #f1f5f9;
        border-radius: 10px;
    }
    .scroll-container::-webkit-scrollbar-thumb {
        background: #10b981; /* Warna hijau EkoOlah */
        border-radius: 10px;
    }
    .scroll-container::-webkit-scrollbar-thumb:hover {
        background: #059669; /* Warna hijau gelap saat di-hover */
    }
}

.scroll-card {
    flex: 0 0 auto;
    width: 260px;
    scroll-snap-align: start;
    margin-right: 1.25rem;

    /* Tambahan agar teks tidak bisa diblok/dipilih saat mouse ditarik */
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* Tambahan agar foto tidak ikut "ketarik" (ghost drag) saat digeser */
.scroll-card img {
    -webkit-user-drag: none;
    pointer-events: none;
}

@media (min-width: 768px) {
    .scroll-card {
        width: 280px;
    }
}

/* Warna Latar Belakang Kartu */
.bg-10r-1 {
    background-color: #d1fae5;
    border-color: #a7f3d0;
}
.bg-10r-2 {
    background-color: #e0e7ff;
    border-color: #c7d2fe;
}
.bg-10r-3 {
    background-color: #fef08a;
    border-color: #fde047;
}
.bg-10r-4 {
    background-color: #ffedd5;
    border-color: #fdba74;
}
.bg-10r-5 {
    background-color: #fce7f3;
    border-color: #fbcfe8;
}

/* --- Gaya Khusus Sesi Contoh 10R --- */
.example-scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 20px;
    scrollbar-width: none;
    cursor: grab;
}

.example-scroll-container::-webkit-scrollbar {
    display: none;
}

.example-card {
    flex: 0 0 auto;
    width: 280px;
    margin-right: 1.5rem;
    scroll-snap-align: start;
    border: 1px solid rgba(0, 0, 0, 0.05);
    /* Agar tidak bisa di-select/blok saat di-drag */
    user-select: none;
    -webkit-user-select: none;
}

/* Gambar di dalam kartu contoh */
.example-img {
    height: 150px;
    width: 100%;
    object-fit: cover;
    border-radius: 12px;
    /* Mencegah gambar ikut ketarik (ghost image) saat drag */
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Warna Pastel Kartu */
.example-bg-1 {
    background-color: #f0fdf4;
}
.example-bg-2 {
    background-color: #eff6ff;
}
.example-bg-3 {
    background-color: #fffbeb;
}
.example-bg-4 {
    background-color: #fff7ed;
}
.example-bg-5 {
    background-color: #fdf2f8;
}

/* =========================================
   RESPONSIVE (TABLET & MOBILE)
   ========================================= */
@media (max-width: 991px) {
    .custom-mobile-dropdown {
        background-color: transparent !important;
        border: none !important;
        padding-left: 15px; /* Agak menjorok ke dalam */
    }

    /* Ubah warna teks item dropdown mobile jadi putih/transparan */
    .custom-mobile-dropdown .dropdown-item {
        color: rgba(255, 255, 255, 0.8) !important;
        padding: 8px 15px;
    }

    /* Efek hover di mobile */
    .custom-mobile-dropdown .dropdown-item:hover {
        color: white !important;
        background-color: transparent !important;
        padding-left: 20px; /* Sedikit geser animasi pas ditekan */
        transition: 0.3s;
    }

    /* Khusus tombol logout di mobile (Merah terang) */
    /* Khusus tombol logout di mobile */
    .custom-mobile-dropdown .dropdown-item.text-danger {
        color: #dc3545 !important; /* Warna merah standar yang tegas */
        background-color: white !important; /* Background putih */
        border-radius: 50px; /* Sudut membulat (pill) */
        padding: 8px 25px !important; /* Jarak teks ke tepi kotak */
        margin-top: 10px; /* Jarak dari menu 'Profil Saya' */
        width: fit-content; /* Kotak menyesuaikan panjang teks */
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Efek bayangan halus */
    }

    /* Reset efek hover khusus tombol logout biar kotaknya tidak memanjang/geser */
    .custom-mobile-dropdown .dropdown-item.text-danger:hover {
        background-color: #f8f9fa !important; /* Warna putih sedikit abu saat ditekan */
        padding-left: 25px !important; /* Tetap sama dengan padding awal */
    }
    .hero-section {
        height: auto;
        padding: 100px 0 80px;
        background-position: center top;
    }
    .hero-title {
        font-size: 2rem;
    }
    .leaderboard-overlap {
        margin-top: -40px;
    }
    .card-leaderboard {
        margin-bottom: 15px;
    }

    /* Carousel Adjustment */
    .carousel-control-prev,
    .carousel-control-next {
        width: 40px;
        height: 40px;
        background-color: rgba(16, 42, 67, 0.8);
        top: 30%;
    }
    .carousel-control-prev {
        left: 0;
    }
    .carousel-control-next {
        right: 0;
    }
    .img-dampak {
        height: 220px;
        margin-bottom: 20px;
    }
    .badge-title {
        font-size: 0.9rem;
        padding: 12px 20px;
        width: 100%;
        margin-left: 0 !important;
    }
    .section-dampak h2 {
        font-size: 1.5rem;
        text-align: center;
    }
    .section-dampak p {
        text-align: center !important;
        font-size: 0.9rem;
    }
    .carousel-indicators {
        bottom: -40px;
    }

    /* Modal Mobile */
    .modal-img-wrapper {
        height: 250px;
        min-height: 250px;
        padding: 15px;
    }
    .modal-text-content {
        padding: 20px 25px;
    }
    .modal-img-full {
        height: 250px;
    }
}

/* =========================================
   RESPONSIVE KHUSUS SLIDER PLASTIK (HP)
   ========================================= */
@media (max-width: 767px) {
    /* 1. Buat Container Jadi Slider Samping */
    .plastic-scroll-container {
        display: flex;
        flex-wrap: nowrap;
        overflow-x: auto;
        gap: 15px;
        padding-bottom: 20px;
        padding-left: 10px;
        padding-right: 10px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;

        /* INI SOLUSINYA: Paksa mulai dari KIRI, jangan ditengah */
        justify-content: flex-start !important;
    }
    /* Sembunyikan Scrollbar */
    .plastic-scroll-container::-webkit-scrollbar {
        display: none;
    }

    /* Ukuran Item Slider */
    .plastic-item {
        flex: 0 0 45%; /* Lebar kartu 45% layar */
        max-width: 45%;
        scroll-snap-align: center;
    }

    /* 2. Kartu Jadi Pendek & Compact */
    .card-plastic-item {
        height: 280px !important; /* Sesuaikan tinggi total kartu */
    }

    /* 3. Sembunyikan Deskripsi */
    .plastic-content-overlay small {
        display: none !important;
    }

    /* 4. Overlay & Icon */
    .plastic-content-overlay {
        height: 130px !important; /* <-- INI KUNCINYA (Jangan auto) */

        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 10px 5px;

        /* Tengahkan isi (Icon & Judul) */
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }
    .recycle-icon img {
        width: 30px !important;
        margin-bottom: 5px;
    }
    .plastic-content-overlay h6 {
        font-size: 0.9rem;
        margin-bottom: 0;
        line-height: 1.2;
    }
    .link-detail-small {
        margin-top: 4px;
        font-size: 0.65rem;
    }
    .header-ekosetor {
        flex-direction: column !important;
        align-items: flex-start !important;
        text-align: left !important;
        gap: 15px !important;
    }
    .header-ekosetor p {
        font-size: 0.9rem;
    }
    .wrap-btn-setor {
        width: 100%;
    }
    .btn-setor {
        width: 100% !important;
        padding: 12px !important;
    }

    /* 2. Perbaiki Tabel Klasemen biar ngga kegencet */
    .table-klasemen th,
    .table-klasemen td {
        padding: 12px 10px !important; /* Kurangi jarak kiri kanan */
        font-size: 0.85rem !important; /* Kecilin dikit tulisannya */
    }
    .table-klasemen th {
        white-space: nowrap !important; /* Judul tabel pantang turun baris */
    }
    .table-klasemen td.nama-kontributor {
        white-space: normal !important; /* Nama boleh turun baris kalau panjang */
        word-break: break-word;
    }
    .table-klasemen td.total-kg {
        white-space: nowrap !important; /* Angka Kg pantang turun baris */
    }
}
