/* --- Import Font --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700&display=swap');

/* --- Variabel Warna & Desain --- */
:root {
    /* Tema Terang */
    --bg-color: #F4F7FC;
    --text-color: #1A202C;
    --card-bg: #FFFFFF;
    --primary-color: #2DBCA9;
    --primary-hover: #24a897;
    --primary-active: #1f8f7f;
    --secondary-color: #E2E8F0;
    --secondary-text: #3d4852;
    --secondary-hover: #CBD5E0;
    --secondary-active: #A0AEC0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.07), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --slider-bg: #CBD5E0;
    --orange-color: #FC7136; /* <-- Variabel warna oranye ada di sini */
}

[data-theme="dark"] {
    /* Tema Gelap */
    --bg-color: #1A202C;
    --text-color: #E2E8F0;
    --card-bg: #2D3748;
    --primary-color: #00A391;
    --primary-hover: #008a7a;
    --primary-active: #006e62;
    --secondary-color: #4A5568;
    --secondary-text: #E2E8F0;
    --secondary-hover: #718096;
    --secondary-active: #A0AEC0;
    --shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
    --slider-bg: #4A5568;
}

/* --- Reset & Gaya Dasar --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100%;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- Kontainer Utama --- */
.container {
    background-color: var(--card-bg);
    width: 100%;
    max-width: 420px;
    height: 100%;
    max-height: 800px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease;
    position: relative; /* Ini penting untuk posisi footnote */
}

/* --- Header --- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}
.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

/* --- Tombol Kontrol Atas --- */
.top-controls {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin: 1.25rem 0;
    flex-shrink: 0;
}

/* --- Konten Utama (Counter & Tombol) --- */
.counter-main {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2rem;
}

.counter-display {
    font-size: 7rem;
    font-weight: 700;
    line-height: 1;
}

/* --- Tombol Utama (Increment) --- */
.btn-increment {
    background: linear-gradient(145deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    width: 90%; 
    height: 140px; 
    border-radius: 40px; 
    font-size: 4rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 20px -5px var(--primary-color);
    transition: all 0.2s ease-in-out;
    display: flex;
    justify-content: center;
    align-items: center;
}
.btn-increment:hover {
    transform: translateY(-5px);
    box-shadow: 0 9px 25px -5px var(--primary-color);
}
.btn-increment:active {
    transform: translateY(-2px) scale(0.99);
    background: linear-gradient(145deg, var(--primary-active), var(--primary-hover));
    box-shadow: 0 5px 15px -5px var(--primary-color);
}

/* --- Tombol Sekunder & Dropdown --- */
.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--secondary-text);
    border: none;
    border-radius: 10px;
    padding: 0.75rem 1.25rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}
.btn-secondary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
}
.btn-secondary:active {
    transform: translateY(0) scale(0.98);
    background-color: var(--secondary-active);
}

/* Dropdown */
.select-step {
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* Tombol Decrement */
.btn-decrement {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* --- GAYA UNTUK FOOTNOTE --- */
.footnote {
    position: absolute;
    bottom: 0.8rem;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-color);
}

/* Gaya untuk link di footnote */
.footnote .supporter-link {
    text-decoration: none;
    color: inherit; /* Warna tulisan 'By MazYoez' akan mengikuti .supporter-name */
}

.footnote .supporter-name {
    color: var(--orange-color);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: transparent;
    transition: text-decoration-color 0.2s ease;
}

.footnote .supporter-link:hover .supporter-name {
    text-decoration-color: var(--orange-color);
}


/* --- Tombol Ganti Tema --- */
.theme-switch .switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}
.theme-switch .switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.theme-switch .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--slider-bg);
    transition: .4s;
    border-radius: 26px;
}
.theme-switch .slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
.theme-switch input:checked + .slider {
    background-color: var(--primary-color);
}
.theme-switch input:checked + .slider:before {
    transform: translateX(24px);
}

/* --- Media Queries --- */
@media (max-width: 480px) {
    body {
        align-items: flex-start;
    }
    .container {
        width: 100%;
        height: 100dvh;
        max-height: 100%;
        border-radius: 0;
        box-shadow: none;
    }
    .counter-display {
        font-size: 6rem;
    }
    .btn-increment {
        height: 130px; 
        font-size: 3.5rem;
    }
}

@media (min-width: 481px) {
    .container {
        margin-top: 2rem;
        margin-bottom: 2rem;
        height: auto;
    }
}

/* --- GAYA UNTUK MODAL POP-UP --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}
.modal-content {
    background-color: var(--card-bg);
    color: var(--text-color);
    padding: 2rem;
    border-radius: 16px;
    width: 90%;
    max-width: 350px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    text-align: center;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}
.modal-overlay.show .modal-content {
    transform: scale(1);
}
.modal-content h2 { font-weight: 600; margin-bottom: 0.5rem; }
.modal-content p { margin-bottom: 1.5rem; opacity: 0.8; }
.modal-input { width: 100%; padding: 0.75rem; font-size: 1.5rem; text-align: center; border: 2px solid var(--secondary-color); background-color: var(--bg-color); color: var(--text-color); border-radius: 10px; margin-bottom: 1.5rem; font-family: 'Poppins', sans-serif; }
.modal-input:focus { outline: none; border-color: var(--primary-color); }
.modal-actions { display: flex; justify-content: space-between; gap: 1rem; }
.modal-btn { flex-grow: 1; padding: 0.75rem; border-radius: 10px; }
.btn-primary { background-color: var(--primary-color); color: white; }
.btn-primary:hover { background-color: var(--primary-hover); }