/* ==========================================================================
   PORTAL KEANEKARAGAMAN HAYATI PLTP ULUBELU 1 & 2
   Theme Styling: Nature Forest Green, Emerald, Teal & Modern Clean Design
   ========================================================================== */

:root {
    --kehati-green-dark: #0f392b;
    --kehati-green-primary: #1b5e20;
    --kehati-green-light: #2e7d32;
    --kehati-emerald: #10b981;
    --kehati-teal: #0d9488;
    --kehati-accent: #f59e0b;
    --kehati-bg-light: #f4fbf7;
    --kehati-card-bg: #ffffff;
    --kehati-border: #e2ece6;
    --kehati-text-dark: #192b23;
    --kehati-text-muted: #556b62;
    --kehati-gradient-hero: linear-gradient(135deg, rgba(15, 57, 43, 0.92) 0%, rgba(13, 148, 136, 0.85) 100%);
}

/* Header & Topbar Overrides */
.dtl-topbar {
    background: #0b281f !important;
    color: #cbd5e1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.dtl-topbar a {
    color: #e2e8f0;
}
.dtl-topbar i {
    color: var(--kehati-emerald) !important;
}

.dtl-navbar {
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(15, 57, 43, 0.08);
    padding: 4px 0;
}

.dtl-topbar .topbar-info span {
    white-space: nowrap;
}

@media (min-width: 992px) {
    .navbar-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center;
    }
}

.navbar-nav .nav-link {
    color: var(--kehati-text-dark) !important;
    font-weight: 700 !important;
    font-size: 0.82rem !important;
    white-space: nowrap !important;
    padding: 8px 9px !important;
    letter-spacing: 0.25px;
    text-transform: uppercase;
    transition: all 0.2s ease;
    border-radius: 6px;
}
.navbar-nav .nav-link:hover {
    color: var(--kehati-green-light) !important;
    background: rgba(46, 125, 50, 0.06);
}
.navbar-nav .nav-link.active {
    color: var(--kehati-green-primary) !important;
    background: rgba(27, 94, 32, 0.08);
}

.btn-cta, .btn-logistik-primary {
    background: linear-gradient(135deg, var(--kehati-green-light), var(--kehati-teal)) !important;
    border: none !important;
    color: #ffffff !important;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.25);
    transition: all 0.25s ease;
}
.btn-cta:hover, .btn-logistik-primary:hover {
    background: linear-gradient(135deg, var(--kehati-green-dark), var(--kehati-green-light)) !important;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(15, 57, 43, 0.35);
}

/* Hero Section */
.kehati-hero {
    position: relative;
    background-size: cover;
    background-position: center;
    color: #ffffff;
    padding: 100px 0 80px;
    min-height: 560px;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.kehati-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(11, 40, 31, 0.92) 0%, rgba(15, 57, 43, 0.82) 50%, rgba(13, 148, 136, 0.72) 100%);
}
.kehati-hero .container {
    position: relative;
    z-index: 2;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.4);
    backdrop-filter: blur(8px);
    padding: 6px 16px;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #a7f3d0;
    margin-bottom: 20px;
}

.hero-title {
    font-size: clamp(1.85rem, 5vw, 2.75rem);
    font-weight: 800;
    line-height: 1.22;
    margin-bottom: 20px;
    color: #ffffff;
    letter-spacing: -0.5px;
    overflow-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}
.hero-title span {
    color: #6ee7b7;
}

.hero-subtitle {
    font-size: 1.15rem;
    line-height: 1.6;
    color: #e2ece6;
    max-width: 650px;
    margin-bottom: 30px;
}

/* Metric Counter Cards */
.kehati-counter-section {
    margin-top: -50px;
    position: relative;
    z-index: 5;
    margin-bottom: 60px;
}

.counter-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 20px;
    box-shadow: 0 10px 30px rgba(15, 57, 43, 0.08);
    border: 1px solid var(--kehati-border);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 16px;
}
.counter-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 35px rgba(15, 57, 43, 0.12);
    border-color: var(--kehati-emerald);
}
.counter-icon {
    width: 58px;
    height: 58px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}
.counter-icon.green { background: #dcfce7; color: #166534; }
.counter-icon.blue { background: #e0f2fe; color: #075985; }
.counter-icon.amber { background: #fef3c7; color: #b45309; }
.counter-icon.teal { background: #ccfbf1; color: #115e59; }

.counter-number {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--kehati-text-dark);
    margin-bottom: 4px;
    font-family: 'Barlow Condensed', sans-serif;
}
.counter-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--kehati-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Section Header */
.section-header-kehati {
    margin-bottom: 40px;
}
.section-pill {
    display: inline-block;
    background: #e8f5e9;
    color: var(--kehati-green-light);
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 5px 14px;
    border-radius: 30px;
    margin-bottom: 12px;
}
.section-title-kehati {
    font-size: clamp(1.45rem, 4.2vw, 2.2rem);
    font-weight: 800;
    color: var(--kehati-text-dark);
    line-height: 1.25;
    letter-spacing: -0.5px;
    overflow-wrap: break-word;
    word-break: break-word;
}
.section-desc-kehati {
    color: var(--kehati-text-muted);
    font-size: 1.05rem;
    max-width: 680px;
    margin: 10px auto 0;
}

/* Species Card */
.spesies-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--kehati-border);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}
.spesies-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(15, 57, 43, 0.12);
    border-color: var(--kehati-emerald);
}
.spesies-card-img-wrap {
    position: relative;
    width: 100%;
    padding-top: 68%;
    background: #e2ece6;
    overflow: hidden;
}
.spesies-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}
.spesies-card:hover .spesies-card-img {
    transform: scale(1.06);
}
.spesies-card-badges {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    z-index: 2;
}
.spesies-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.spesies-badge.dilindungi { background: #fee2e2; color: #991b1b; }
.spesies-badge.tidak-dilindungi { background: #f3f4f6; color: #4b5563; }
.spesies-badge.iucn-cr { background: #991b1b; color: #ffffff; }
.spesies-badge.iucn-en { background: #c2410c; color: #ffffff; }
.spesies-badge.iucn-vu { background: #d97706; color: #ffffff; }
.spesies-badge.iucn-nt { background: #ca8a04; color: #ffffff; }
.spesies-badge.iucn-lc { background: #15803d; color: #ffffff; }
.spesies-badge.iucn-dd { background: #4b5563; color: #ffffff; }
.spesies-badge.iucn-ne { background: #6b7280; color: #ffffff; }

.spesies-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.spesies-kelompok-tag {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--kehati-teal);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}
.spesies-nama-lokal {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--kehati-text-dark);
    margin-bottom: 4px;
}
.spesies-nama-ilmiah {
    font-size: 0.92rem;
    font-style: italic;
    color: var(--kehati-text-muted);
    margin-bottom: 12px;
}
.spesies-meta-grid {
    background: #f8faf9;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 0.82rem;
    margin-top: auto;
    margin-bottom: 16px;
}
.spesies-meta-row {
    display: flex;
    justify-content: space-between;
    padding: 3px 0;
    border-bottom: 1px dashed #e2ece6;
}
.spesies-meta-row:last-child { border-bottom: none; }
.spesies-meta-label { color: var(--kehati-text-muted); font-weight: 500; }
.spesies-meta-val { font-weight: 600; color: var(--kehati-text-dark); }

/* Chart Container Cards */
.kehati-chart-card {
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid var(--kehati-border);
    padding: 24px;
    box-shadow: 0 4px 20px rgba(15, 57, 43, 0.05);
    height: 100%;
}
.kehati-chart-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--kehati-text-dark);
    margin-bottom: 4px;
}
.kehati-chart-sub {
    font-size: 0.85rem;
    color: var(--kehati-text-muted);
    margin-bottom: 20px;
}

/* Activity Card */
.program-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--kehati-border);
    box-shadow: 0 4px 18px rgba(15, 57, 43, 0.05);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}
.program-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 32px rgba(15, 57, 43, 0.1);
    border-color: var(--kehati-emerald);
}
.program-card-img {
    height: 220px;
    width: 100%;
    object-fit: cover;
}
.program-card-body {
    padding: 22px;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.program-date {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--kehati-teal);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.program-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--kehati-text-dark);
    line-height: 1.35;
    margin-bottom: 12px;
}
.program-desc {
    color: var(--kehati-text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
    margin-bottom: 16px;
    flex: 1;
}

/* Detail Spesies Styles */
.spesies-detail-header {
    background: linear-gradient(135deg, #0b281f 0%, #115e59 100%);
    color: #ffffff;
    padding: 50px 0 40px;
    margin-bottom: 40px;
}
.spesies-detail-hero-img {
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 4px solid #ffffff;
    width: 100%;
    max-height: 400px;
    object-fit: cover;
}

/* Footer Overrides */
.dtl-footer {
    background: #092019 !important;
    color: #94a3b8;
    padding-top: 60px;
}
.footer-brand-name {
    color: #ffffff !important;
    font-size: 1.3rem;
    font-weight: 700;
}
.footer-brand-tagline {
    color: var(--kehati-emerald) !important;
    font-weight: 600;
}
.footer-title {
    color: #ffffff !important;
    font-size: 1.1rem;
    font-weight: 700;
    border-bottom: 2px solid var(--kehati-green-light);
    display: inline-block;
    padding-bottom: 8px;
    margin-bottom: 20px;
}
.footer-links a {
    color: #cbd5e1 !important;
    transition: all 0.2s ease;
}
.footer-links a:hover {
    color: #34d399 !important;
    padding-left: 6px;
}
.footer-copyright {
    background: #061611 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    color: #64748b;
}

/* Loading Screen Override */
#dtl-loading {
    background: #0b281f !important;
}
#dtl-loading .loader-logo {
    color: #ffffff !important;
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}
#dtl-loading .loader-logo span {
    color: var(--kehati-emerald) !important;
}
#dtl-loading .loader-fill {
    background: linear-gradient(90deg, var(--kehati-green-light), var(--kehati-emerald)) !important;
}

/* ==========================================================================
   MOBILE & RESPONSIVE REFINEMENTS (ANTI-OVERFLOW)
   ========================================================================== */
html, body {
    max-width: 100vw;
    overflow-x: hidden;
}

img, canvas, svg {
    max-width: 100%;
}

@media (max-width: 991.98px) {
    .navbar-brand {
        max-width: calc(100% - 90px) !important;
    }
    .navbar-brand img {
        max-height: 40px !important;
    }
    .kehati-hero {
        padding: 70px 0 60px;
        min-height: auto;
    }
}

@media (max-width: 767.98px) {
    .hero-title {
        font-size: clamp(1.45rem, 6.2vw, 1.95rem) !important;
        line-height: 1.25 !important;
    }
    .hero-subtitle {
        font-size: 0.95rem !important;
        line-height: 1.5 !important;
        margin-bottom: 22px !important;
    }
    .hero-badge {
        font-size: 0.76rem !important;
        padding: 5px 12px !important;
        max-width: 100%;
        white-space: normal;
        line-height: 1.35;
        display: inline-flex;
    }
    .section-title-kehati {
        font-size: clamp(1.25rem, 4.8vw, 1.65rem) !important;
        line-height: 1.25 !important;
    }
    .section-desc-kehati {
        font-size: 0.92rem !important;
    }
    .kehati-counter-section {
        margin-top: -25px !important;
        margin-bottom: 30px !important;
    }
    .counter-card {
        padding: 14px 12px !important;
        gap: 12px !important;
    }
    .counter-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 1.2rem !important;
        border-radius: 10px !important;
    }
    .counter-number {
        font-size: 1.55rem !important;
    }
    .counter-label {
        font-size: 0.72rem !important;
    }
    .kehati-chart-card {
        padding: 16px 14px !important;
    }
    .kehati-chart-title {
        font-size: 1rem !important;
    }
    .kehati-chart-sub {
        font-size: 0.78rem !important;
        margin-bottom: 14px !important;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 14px;
        padding-right: 14px;
    }
    .navbar-brand {
        max-width: calc(100% - 85px) !important;
    }
    .navbar-brand img {
        max-height: 36px !important;
    }
    .navbar-brand .brand-name {
        font-size: 0.92rem !important;
    }
    .program-card-img {
        height: 180px !important;
    }
}

