/* style.css */

/* --- GLOBAL RESET & UTILITIES --- */
* {
    box-sizing: border-box; /* Penting untuk konsistensi layout */
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Montserrat', sans-serif;
    /* BACKGROUND UTAMA */
    background: linear-gradient(135deg, rgba(44, 62, 80, 0.9), rgba(76, 161, 175, 0.9)), url('https://daun-to-to.site/assets/images/bg.webp'); /* GANTI URL INI */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #ecf0f1;
    line-height: 1.6;
    overflow-x: hidden; /* Mencegah scroll horizontal */
}

.hidden-by-default {
    display: none !important;
}

/* --- HEADER (Desktop Layout) --- */
.main-header {
    /* BACKGROUND HEADER */
    background: linear-gradient(rgba(52, 73, 94, 0.8), rgba(52, 73, 94, 0.8)), url('https://daun-to-to.site/assets/images/footer.webp'); /* GANTI URL INI */
    background-size: cover;
    background-position: center;
    padding: 15px 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

/* Grouping untuk elemen header */
.header-group {
    display: flex;
    align-items: center;
}

.header-group-left {
    justify-content: flex-start;
    flex-grow: 1;
}
.header-group-center {
    justify-content: center;
    flex-grow: 1;
}
.header-group-right {
    justify-content: flex-end;
    flex-grow: 1;
}


.header-logo {
    height: 50px;
}

.header-button {
    background-color: #f39c12;
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 5px;
    margin: 0 5px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
    font-weight: bold;
}

.header-button:hover {
    background-color: #e67e22;
}

.header-button.primary {
    background-color: #27ae60;
}

.header-button.primary:hover {
    background-color: #229a54;
}

/* --- MAIN CONTENT LAYOUT (Desktop: 2 kolom) --- */
.main-content-layout {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    padding: 30px 20px;
    max-width: 1200px;
    margin: 20px auto;
}

/* --- Section Kiri (Roda) & Kanan (Riwayat Spin) --- */
.content-left {
    /* BACKGROUND KIRI */
    background-image: linear-gradient(rgba(52, 73, 94, 0.7), rgba(52, 73, 94, 0.7)), url('https://daun-to-to.site/assets/images/bgkiri.webp'); /* GANTI URL INI */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex: 1;
    min-width: 300px;
    border: 3px solid #f39c12;
    animation: border-glow 2s infinite alternate;
}

.content-right {
    /* BACKGROUND KANAN */
    background-image: linear-gradient(rgba(52, 73, 94, 0.7), rgba(52, 73, 94, 0.7)), url('https://daun-to-to.site/assets/images/bgkanan.webp'); /* GANTI URL INI */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #34495e;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    flex: 1;
    min-width: 300px;
    border: 3px solid #f39c12;
    animation: border-glow 2s infinite alternate;
}

h2 {
    color: #f39c12;
    text-align: center;
    margin-bottom: 25px;
    font-size: 1.8em;
}

/* --- WHEEL SECTION --- */
#wheel-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.wheel-container {
    position: relative;
    width: 390px; /* Ukuran asli dari blueprint yang sudah bulat */
    height: 390px; /* Ukuran asli dari blueprint yang sudah bulat */
    border-radius: 50%;
    overflow: hidden; /* Penting untuk clipping konten di dalam lingkaran */
    margin-bottom: 20px;
    box-shadow: inset 0 0 10px rgba(0,0,0,0.5), 0 0 20px rgba(0,0,0,0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1; /* Memberikan z-index dasar untuk roda */
}

/* Gaya untuk Bingkai Roda */
.wheel-frame {
    position: absolute;
    top: -22%;
    left: -23%;
    width: 145%;
    height: 145%;
    /* MODIFIKASI: background-size menjadi contain */
    background: url('https://daun-to-to.site/assets/images/gold-circle-png-thumb15.webp') no-repeat center center; /* Menggunakan gambar yang sama dengan wheel-container sebagai contoh */
    background-size: contain; /* PENTING: Gunakan 'contain' untuk menjaga rasio aspek gambar */
    background-repeat: no-repeat; /* Pastikan tidak berulang */
    background-position: center center; /* Pastikan di tengah */
    z-index: 5;
    pointer-events: none;
}


#luckyWheelCanvas {
    display: block;
    transition: transform 4s cubic-bezier(0.25, 0.1, 0.25, 1);
    z-index: 2; /* Di atas background container, tapi di bawah bingkai */
}

/* Panah Penunjuk */
.wheel-spin__win-arrow {
    position: absolute;
    width: 98px;
    height: 74px;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10; /* Pastikan panah di paling atas */
    filter: drop-shadow(0px 4px 4px rgba(0, 0, 0, 0.25));
}

/* Input Group & Buttons */
.input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    width: 100%;
    max-width: 350px;
}

.input-group input[type="text"] {
    flex-grow: 1;
    padding: 12px 15px;
    border: 1px solid #56728c;
    border-radius: 8px;
    background-color: #253340;
    color: #ecf0f1;
    font-size: 1em;
    outline: none;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}

.input-group input[type="text"]:focus {
    border-color: #f39c12;
    box-shadow: 0 0 12px rgba(243, 156, 18, 0.9);
}

.input-group button, #spinBtn {
    padding: 12px 25px;
    background-color: #27ae60;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.1s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    white-space: nowrap;
    border: 2px solid #2ecc71;
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.5), 0 2px 5px rgba(0,0,0,0.2);
}

.input-group button:hover, #spinBtn:hover {
    background-color: #229a54;
    transform: translateY(-2px);
    border-color: #f39c12;
    box-shadow: 0 0 15px rgba(243, 156, 18, 0.8), 0 4px 10px rgba(0,0,0,0.3);
}

.input-group button:disabled, #spinBtn:disabled {
    background-color: #7f8c8d;
    cursor: not-allowed;
    transform: translateY(0);
    border-color: #6c757d;
    box-shadow: none;
}

#spinInputGroup {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 350px;
    gap: 15px;
}
#spinInputGroup .input-group {
    margin-bottom: 0;
}


/* Spin Result Message */
.message {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
    font-weight: bold;
    text-align: center;
    width: 100%;
    max-width: 350px;
}

.message.success {
    background-color: #28a745;
    color: white;
}

.message.error {
    background-color: #dc3545;
    color: white;
}

.message.info {
    background-color: #17a2b8;
    color: white;
}

/* --- HISTORY SECTION --- */
#history-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

#history-section th, #history-section td {
    border: 1px solid #4a6279;
    padding: 12px;
    text-align: left;
}

#history-section th {
    background-color: #2f3e4e;
    color: #f39c12;
    font-weight: bold;
    text-transform: uppercase;
}

#history-section tr:nth-child(even) {
    background-color: #3e5369;
}

/* --- PAGINATION TABS --- */
.pagination-tabs {
    display: flex;
    justify-content: center;
    margin-top: 20px;
    flex-wrap: wrap;
    gap: 5px;
}
.pagination-tabs button {
    background-color: #7859ec;
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1em;
    transition: background-color 0.3s ease;
}
.pagination-tabs button:hover:not(.active) {
    background-color: #5a40b9;
}
.pagination-tabs button.active {
    background-color: #3b288e;
    font-weight: bold;
    cursor: default;
}
.pagination-tabs button[disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}


/* --- MODAL (Pop-up Notifikasi) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.4);
    justify-content: center;
    align-items: center;
}

.modal-content-notification {
    background-color: #34495e;
    padding: 20px;
    border: 1px solid #f39c12;
    border-radius: 10px;
    width: 80%;
    max-width: 400px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    position: relative;
    text-align: center;
    transform: scale(0.9);
    opacity: 0;
    animation: fadeInScale 0.3s forwards;
}

.modal-content-notification .close-notification {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.modal-content-notification .close-notification:hover,
.modal-content-notification .close-notification:focus {
    color: #f39c12;
    text-decoration: none;
    cursor: pointer;
}

.modal-content-notification p {
    font-size: 1.2em;
    color: #ecf0f1;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* Animasi untuk pop-up */
@keyframes fadeInScale {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Warna pesan di pop-up */
.modal-content-notification .success {
    color: #2ecc71;
}

.modal-content-notification .error {
    color: #e74c3c;
}

.modal-content-notification .info {
    color: #3498db;
}

/* --- MODAL BARU UNTUK KONTEN CLAIM & CARA MAIN --- */
#generalContentModal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    justify-content: center;
    align-items: center;
}

.general-content-modal-box {
    background-color: #34495e;
    padding: 30px;
    border: 1px solid #f39c12;
    border-radius: 10px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.5);
    position: relative;
    color: #ecf0f1;
    text-align: left;
    transform: scale(0.9);
    opacity: 0;
    animation: fadeInScale 0.3s forwards;
    line-height: 1.8;
}

.general-content-modal-box h3 {
    color: #f39c12;
    text-align: center;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.general-content-modal-box .modal-body p {
    margin-bottom: 15px;
}

/* Tombol Tutup untuk Modal Konten Umum */
.close-general-content-modal {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
}

.close-general-content-modal:hover,
.close-general-content-modal:focus {
    color: #f39c12;
    text-decoration: none;
    cursor: pointer;
}


/* --- SYARAT & KETENTUAN SECTION --- */
#terms-section {
    width: 100%;
    max-width: 1200px;
    margin: 30px auto;
    background-color: #34495e;
    /* BACKGROUND FOOTER */
    background-image: linear-gradient(rgba(52, 73, 94, 0.7), rgba(52, 73, 94, 0.7)), url('https://daun-to-to.site/assets/images/header.webp');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    border: 3px solid #f39c12;
    animation: border-glow 2s infinite alternate;
}

.terms-content {
    text-align: left;
    color: #ecf0f1;
}

.terms-content h2 {
    color: #f39c12;
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.terms-content p {
    margin-bottom: 10px;
    font-size: 1em;
}

.wheel-center-logo {
    position: absolute;
    width: 100px; /* Ukuran logo di tengah, sesuaikan */
    height: 100px; /* Ukuran logo di tengah, sesuaikan */
    border-radius: 50%; /* Agar berbentuk lingkaran */
    background-color: #2f3e4e; /* Warna background jika gambar tidak ada */
    background-image: url('https://daun-to-to.site/assets/images/center_wheel_image.webp'); /* GANTI DENGAN URL LOGO ANDA */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    z-index: 6;
    box-shadow: 0 0 10px rgba(0,0,0,0.3);
}

/* --- ANIMASI BERKILAUAN (GLOW) --- */
@keyframes border-glow {
    0% {
        border-color: #f39c12;
        box-shadow: 0 0 10px rgba(243, 156, 18, 0.5), 0 5px 15px rgba(0,0,0,0.3);
    }
    50% {
        border-color: #ffe0b2;
        box-shadow: 0 0 25px rgba(243, 156, 18, 0.9), 0 5px 25px rgba(0,0,0,0.5);
    }
    100% {
        border-color: #f39c12;
        box-shadow: 0 0 10px rgba(243, 156, 18, 0.5), 0 5px 15px rgba(0,0,0,0.3);
    }
}


/* --- RESPONSIVE ADJUSTMENTS (Media Queries for Mobile) --- */

@media (max-width: 768px) {
    /* --- MOBILE HEADER LAYOUT (3 Baris) --- */
    .main-header {
        flex-direction: column;
        align-items: center;
        padding: 10px 15px;
    }
    .header-group {
        width: 100%;
        justify-content: center;
        margin-bottom: 8px;
        flex-grow: unset;
    }
    .header-group-right {
        margin-bottom: 0;
    }

    .header-logo {
        height: 40px;
    }
    .header-button {
        padding: 6px 12px;
        font-size: 0.9em;
        margin: 3px;
    }
    .header-left, .header-center, .header-right {
        gap: 10px;
    }


    /* --- MOBILE MAIN CONTENT LAYOUT (1 Kolom) --- */
    .main-content-layout {
        flex-direction: column;
        padding: 2px 2px;
        gap: 20px;
    }
    .content-left, .content-right {
        min-width: unset;
        width: 100%;
        height: auto;
    }
    
    /* Penyesuaian untuk wheel-container agar responsif dan bulat di mobile */
    .wheel-container {
        width: 90vw;
        height: 90vw;
        max-width: unset;
    }
    /* Sesuaikan ukuran panah penunjuk jika roda mengecil */
    .wheel-spin__win-arrow {
        width: 60px;
        height: auto;
        top: -8px;
    }

    /* Input & Button group di mobile */
    .input-group {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .input-group input[type="text"], .input-group button, .message {
        width: 100%;
        max-width: 280px;
    }
    #spinInputGroup {
        gap: 10px;
    }
    .message {
        max-width: 280px;
    }

    /* Tabel riwayat spin agar bisa di-scroll horizontal jika terlalu lebar */
    #history-section table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    #history-section table thead, #history-section table tbody, #history-section table tr {
        display: block;
    }
    #history-section table th, #history-section table td {
        white-space: normal;
        min-width: 80px;
    }

    /* Syarat & Ketentuan di mobile */
    #terms-section {
        padding: 20px 15px;
        margin: 20px auto;
    }
    .terms-content h2 {
        font-size: 1.5em;
    }

    /* Modal Konten Umum di Mobile */
    .general-content-modal-box {
        padding: 20px;
        width: 95%;
        max-width: unset;
    }
    .general-content-modal-box h3 {
        font-size: 1.3em;
    }
}

/* Penyesuaian ekstra untuk layar yang sangat kecil (misalnya di bawah 360px) */
@media (max-width: 360px) {
    .header-button {
        font-size: 0.8em;
        padding: 5px 10px;
        margin: 2px;
    }
    .input-group input[type="text"], .input-group button, .message {
        max-width: 250px;
    }
    .wheel-container {
        width: 95vw;
        height: 95vw;
    }
}