/* === Definisi Variabel Warna & Font === */
:root {
    --primary-color: #4a7c59; /* Hijau natural */
    --secondary-color: #f7f4f0; /* Krem lembut */
    --accent-color: #a47c59; /* Coklat aksen */
    --text-color: #3d3d3d;
    --border-color: #e0e0e0;
    --body-bg: #fcfbfa; /* Background utama yang sangat terang */
    --font-family: 'Inter', sans-serif;
}

*{
    color: #3d3d3d;
}

/* === Style Dasar === */
html, body {
    font-family: var(--font-family);
    background-color: var(--body-bg);
    color: var(--text-color);
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.navbar-custom {
    background-color: #3e684b; /* Menggunakan warna body-bg Anda */
    transition:
    box-shadow 0.3s ease;
}



h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: #3d3d3d;
}

th, td {
    color: #3d3d3d;
}

/* === Kustomisasi Komponen Bootstrap & Elemen Lain === */

.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: box-shadow 0.3s ease-in-out;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08) !important;
}

.form-control, .form-select {
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(74, 124, 89, 0.25);
}

.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.25rem;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #3e684b;
    border-color: #3e684b;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

.progress-bar {
    background-color: var(--primary-color);
    font-weight: 600;
}

/* === Style Kustom untuk Bagian Spesifik === */

/* Fix untuk memaksa kolom sama tinggi (lebih kuat) */
/* style.css */

/* === Tata Letak Utama Kalkulator === */
.calculator-body .row {
    min-height: calc(100vh - 72px);
}


main.col-lg-6,
aside.col-lg-6 {
  align-self: start;
}

/* Kolom Kiri yang bisa di-scroll */
main.col-lg-6 { /* <-- Pastikan ukuran kolom sesuai dengan HTML Anda */
    height: 100%;
    overflow-y: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE & Edge lama */
    flex: 1;
    max-height: none;
}

aside::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* Kolom Kanan yang diam */
aside {
  position: sticky;
  /* max-height: calc(100vh - 100px); */
  overflow-y: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE & Edge lama */
  top: 7rem;
}

aside::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* Aturan sticky yang sekarang akan bekerja sempurna (SATU ATURAN SAJA) */
#results-section .sticky-top {
    top: 7rem; /* Jarak dari atas di dalam kolomnya */
}

/* Styling untuk Accordion Cara Penggunaan */
.accordion-button {
    background-color: #f8f9fa;
    color: #495057;
}

.accordion-button:not(.collapsed) {
    color: #0c63e4;
    background-color: #e7f1ff;
    box-shadow: inset 0 -1px 0 rgba(0,0,0,.125);
}

.accordion-button:focus {
    z-index: 3;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.accordion-item {
    border: 1px solid #dee2e6;
    border-radius: .375rem;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
}

.section-title .icon {
    color: var(--primary-color);
    margin-right: 10px;
}

#results-placeholder .fa-clipboard-list {
    color: #e9e9e9;
}

#results-section, main {
  padding-left: 25px;
  padding-right: 25px;
}

.container-fluid > .row {
  max-width: 1200px; /* atur sesuai selera */
  margin: 0 auto;
}

#print-header, #print-watermark, #print-footer {
    display: none;
}

.site-footer {
  background-color: #4a7c59; /* hijau tua biar matching navbar */
  padding: 20px 0 20px;
  margin-top: auto; /* kunci footer biar selalu di bawah */
}

.footer-bottom {
  text-align: center;
  font-size: 0.9rem;
}


/* Penyesuaian untuk layar kecil (Mobile) */
@media (max-width: 992px) {
    #results-section .sticky-top {
        position: static; /* Menonaktifkan 'sticky' di mobile */
    }

    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }

    .container-fluid {
        padding-left: 0.1rem;
        padding-right: 0.01rem;
    }

    .py-5 {
        padding-top: 2.5rem !important;
        padding-bottom: 1rem !important; /* Mengurangi padding bawah di mobile */
    }

    main.col-lg-6, aside.col-lg-6 {
        padding-top: 1rem !important;
        padding-bottom: 2rem !important;
    }

    aside.col-lg-6 {
        position: static !important;   /* matiin sticky biar ikut flow */
        max-height: none !important;   /* biar ga dipotong */
        overflow: visible !important;  /* biar scrollnya pakai body, bukan aside */
        padding-bottom: 5rem;          /* ruang ekstra sebelum footer */
    }
}

/* === ATURAN FINAL UNTUK MENCETAK (STABLE ABSOLUTE LOGO) === */
/* === ATURAN BARU UNTUK MENCETAK (LEBIH STABIL) === */
@media print {
    /* 1. Sembunyikan elemen yang tidak perlu */
    body > .navbar, 
    body > .container,
    main.col-lg-6,
    #download-pdf-btn,
    #print-watermark {
        display: none !important;
    }
    
    /* Reset body untuk print */
    body {
        margin: 0;
        padding: 20px; 
        background-color: white; /* Pastikan background putih */
        font-size: 10pt;
        padding-bottom: 50px;
    }

    /* 2. Atur Header agar menjadi blok biasa, bukan fixed */
    #print-header {
        display: flex;
        align-items: center;
        justify-content: center;
        border-bottom: 2px solid #e0e0e0;
        padding-bottom: 15px;
        margin-bottom: 20px; 
        page-break-after: avoid; /* Beri jarak ke konten di bawahnya */
        /* Hapus position: fixed, top, left, right, z-index, height */
    }
    #print-header .logo { height: 50px; margin-right: 15px; }
    #print-header h1 { font-size: 2rem; margin: 0; }

    /* 3. Atur Konten Utama */
    .container-fluid,
    .container-fluid > .row {
        max-width: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    aside.col-lg-6 {
        width: 100% !important;
        padding: 0 !important; /* HAPUS padding berlebih */
        margin: 0 !important;  /* HAPUS margin berlebih */
        page-break-inside: avoid;
    }
    .card { 
        border: none !important; 
        box-shadow: none !important; 
        margin: 0 !important;
    }
    #results-output { 
        display: block !important; 
        visibility: visible !important;
        font-size: 0.8rem; 
        page-break-after: avoid !important;
    }

    /* 4. Atur Footer agar menjadi blok biasa di akhir dokumen */
    #print-footer {
        position: fixed;
        bottom: 0;   /* ⬅️ selalu di bawah kertas */
        left: 0;
        right: 0;

        display: flex;
        align-items: center;
        justify-content: space-between;

        border-top: 1px solid #e0e0e0;
        padding: 10px 20px;
        font-size: 0.8rem;
        color: #666;
        background: #fff; /* biar nutup konten di belakang */
        page-break-before: avoid !important;
        page-break-inside: avoid !important;
    }
    .footer-logo-inline { height: 25px; margin-right: 15px; }
    #print-footer p { flex-grow: 1; margin: 0; text-align: left; }

    /* Aturan untuk nomor halaman (jika didukung library) */
    #print-footer .page-number::after {
        counter-increment: page;
        content: "Halaman " counter(page);
    }
}

