:root {
    /* --primary-bg: linear-gradient(135deg, #2c0047 0%, #1a002e 100%); -- Kita akan ganti ini */
    --container-bg: rgba(22, 11, 40, 0.85); /* Dark, slightly transparent purple */
    --container-border: rgba(255, 255, 255, 0.15);
    --text-color: #f0e6ff; /* Light Lavender */
    --title-color: #ff8fdf; /* Bright Pink */
    --accent-color: #ff69b4; /* Hot Pink */
    --accent-hover: #ff4da6;
    --input-bg: rgba(255, 255, 255, 0.1);
    --input-border: rgba(255, 255, 255, 0.2);
    --placeholder-color: rgba(240, 230, 255, 0.7); /* sedikit lebih terang untuk kontras */
    --error-color: #ff5c8a;
    --download-btn-bg: #00bcd4; /* Cyan */
    --download-btn-hover: #00acc1;
    --font-primary: 'M PLUS Rounded 1c', 'Poppins', sans-serif;
    --background-overlay-color: rgba(10, 2, 20, 0.65); /* Overlay gelap untuk keterbacaan teks */
}

body {
    font-family: var(--font-primary);
    /* Menetapkan gambar background anime */
    background-image: url('image/background.jpg'); /* GANTI DENGAN PATH GAMBAR ANDA */
    background-size: cover; /* Membuat gambar menutupi seluruh area */
    background-position: center center; /* Memusatkan gambar */
    background-repeat: no-repeat; /* Mencegah gambar berulang */
    /* background-attachment: fixed;  Membuat background tetap saat scroll (efek parallax sederhana) */
    
    margin: 0;
    padding: 20px; /* Padding agar konten tidak menempel di tepi layar */
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    color: var(--text-color);
    overflow-x: hidden;
    position: relative; /* Diperlukan untuk pseudo-element overlay */
    z-index: 0; /* Dasar untuk stacking context */
}

/* Membuat lapisan overlay di atas background image untuk meningkatkan kontras teks */
body::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--background-overlay-color);
    z-index: -1; /* Letakkan overlay di belakang konten, tapi di atas background-image body */
}

.main-container {
    position: relative; /* Agar bisa diatur z-indexnya di atas overlay */
    width: 100%;
    display: flex;
    /*flex-direction: column;*/
    justify-content: center;
    align-items: center;
    z-index: 1; /* Pastikan main-container berada di atas overlay body */
    padding-top: 50px;
}

.container {
    width: 90%;
    max-width: 700px;
    background-color: var(--container-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(124, 42, 244, 0.3); /* Bisa disesuaikan agar lebih terlihat di atas bg baru */
    border: 1px solid var(--container-border);
    padding: 30px 40px;
    text-align: center;
    position: relative; 
    z-index: 2; /* Pastikan container di atas elemen lain di dalam main-container */
}

h1 {
    color: var(--title-color);
    margin-bottom: 15px;
    font-size: 2.2em;
    font-weight: 700;
    text-shadow: 0 0 5px rgba(0,0,0,0.4), 0 0 10px var(--title-color), 0 0 15px var(--title-color); /* Sedikit shadow hitam agar lebih menonjol */
}

p {
    color: var(--text-color);
    opacity: 0.9;
    margin-bottom: 35px;
    font-size: 1.1em;
    text-shadow: 0 0 3px rgba(0,0,0,0.3); /* Shadow tipis untuk keterbacaan */
}

input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    border-right: none;
    font-family: var(--font-primary);
    text-shadow: none; /* Pastikan tidak ada shadow di input field */
}

input[type="text"]::placeholder {
    color: var(--placeholder-color);
    opacity: 1; /* Opacity placeholder diset ke 1 agar lebih jelas */
}

#error-message {
    color: var(--error-color);
    margin-top: 20px;
    font-weight: 500;
    background-color: rgba(255, 92, 138, 0.2); /* Background sedikit lebih terang */
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid var(--error-color);
    text-shadow: none;
}

.input-group {
    display: flex;
    margin-bottom: 30px;
    border-radius: 10px;
    overflow: hidden; /* To make child border-radius work correctly */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid var(--input-border);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
    outline: none;
    border-right: none; /* Remove right border, button will cover */
    font-family: var(--font-primary);
}

input[type="text"]::placeholder {
    color: var(--placeholder-color);
    opacity: 0.8;
}

button#download-btn {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 15px 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.1s ease;
    font-family: var(--font-primary);
}

button#download-btn:hover {
    background-color: var(--accent-hover);
    transform: scale(1.05);
}
button#download-btn:active {
    transform: scale(0.98);
}

.result-container {
    margin-top: 30px;
    display: none; /* Initially hidden */
    background-color: rgba(0,0,0,0.1); /* Slightly different background for results */
    padding: 20px;
    border-radius: 15px;
}

/* Video Info Styling */
.video-info {
    margin-bottom: 20px;
    text-align: left;
    padding: 15px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.author-info {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.author-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 15px;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}

.author-details h3 {
    margin: 0;
    font-size: 1.1em;
    color: var(--text-color);
    font-weight: 500;
}

.author-details p {
    margin: 5px 0 0;
    font-size: 0.9em;
    color: var(--placeholder-color);
}

.video-title {
    font-size: 1em;
    font-weight: 500;
    margin: 15px 0;
    color: var(--text-color);
    line-height: 1.5;
}

.video-stats {
    display: flex;
    gap: 20px;
    font-size: 0.9em;
    color: var(--placeholder-color);
    justify-content: flex-start; /* Align to left */
}
.video-stats span {
    display: flex;
    align-items: center;
}

#video-preview {
    margin-bottom: 20px;
}

.tiktok-video { /* Class for the video element itself */
    width: 100%;
    max-height: 450px;
    border-radius: 10px;
    background-color: #000;
    border: 1px solid var(--input-border);
}

.download-options-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

.download-option {
    display: inline-block;
    padding: 12px 25px;
    background-color: var(--download-btn-bg);
    color: white;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.95em;
    box-shadow: 0 2px 8px rgba(0, 188, 212, 0.3);
}

.download-option:hover {
    background-color: var(--download-btn-hover);
    transform: translateY(-2px) scale(1.03);
}

#error-message {
    color: var(--error-color);
    margin-top: 20px;
    font-weight: 500;
    background-color: rgba(255, 92, 138, 0.1);
    padding: 10px;
    border-radius: 8px;
    border: 1px solid var(--error-color);
}

.loading {
    display: none; /* Initially hidden */
    flex-direction: column;
    align-items: center;
    margin-top: 30px;
}

.spinner {
    border: 5px solid rgba(255, 105, 180, 0.2); /* Light pink transparent */
    border-radius: 50%;
    border-top: 5px solid var(--accent-color); /* Hot Pink */
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

.loading p {
    font-size: 1.1em;
    color: var(--accent-color);
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 20px;
    }
    h1 {
        font-size: 1.8em;
    }
    p {
        font-size: 1em;
    }
    .author-info {
        flex-direction: column;
        text-align: center;
    }
    .author-avatar {
        margin-right: 0;
        margin-bottom: 10px;
    }
    .video-stats {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .input-group {
        flex-direction: column;
        box-shadow: none;
    }
    input[type="text"] {
        border-radius: 10px;
        border-right: 1px solid var(--input-border); /* Add back border */
        margin-bottom: 10px;
        text-align: center;
    }
    button#download-btn {
        border-radius: 10px;
        width: 100%;
    }
    .download-options-container {
        flex-direction: column;
    }
    .download-option {
        width: 100%;
        box-sizing: border-box; /* Ensure padding doesn't make it overflow */
        text-align: center;
    }
}

.about-icon-trigger {
    position: absolute; /* Posisi absolut relatif terhadap .main-container */
    top: 15px; /* Jarak dari atas .main-container (setelah padding-top .main-container) */
    right: 20px; /* Jarak dari kanan .main-container */
    background-color: rgba(var(--accent-color-rgb, 255, 105, 180), 0.5); /* Warna semi-transparan */
    color: white;
    border: none;
    width: 40px; /* Ukuran tombol ikon */
    height: 40px;
    border-radius: 50%; /* Membuatnya bulat */
    cursor: pointer;
    font-size: 20px; /* Ukuran ikon emoji/font */
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    z-index: 100; /* Pastikan di atas elemen lain di main-container kecuali modal */
}

.about-icon-trigger:hover {
    background-color: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(var(--accent-color-rgb, 255, 105, 180), 0.5);
}

.about-icon-trigger .icon-info {
    line-height: 1; /* Untuk alignment emoji yang lebih baik */
}


/* Footer Styling */
.site-footer {
    width: 100%;
    text-align: center;
    padding: 20px 0;
    margin-top: 40px; /* Jarak dari kontainer utama */
    color: var(--placeholder-color); /* Warna lebih soft */
    font-size: 0.9em;
    position: relative; /* Untuk z-index jika diperlukan */
    z-index: 1;
}

.site-footer p {
    margin: 5px 0;
    line-height: 1.6;
    font-size: 0.95em; /* Sesuaikan ukuran font footer */
    color: rgba(240, 230, 255, 0.7); /* Warna teks lebih soft */
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.site-footer .heart {
    color: var(--accent-color);
    font-size: 1.2em;
    display: inline-block;
    animation: heartbeat 1.5s infinite;
}

@keyframes heartbeat {
    0% { transform: scale(1); }
    14% { transform: scale(1.3); }
    28% { transform: scale(1); }
    42% { transform: scale(1.3); }
    70% { transform: scale(1); }
}

.modal {
    display: none; /* Hidden by default */
    position: fixed; /* Stay in place */
    z-index: 1000; /* Sit on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto; /* Enable scroll if needed */
    background-color: rgba(0,0,0,0.7); /* Black w/ opacity - backdrop */
    backdrop-filter: blur(5px); /* Blur background behind modal */
    -webkit-backdrop-filter: blur(5px);
    padding-top: 60px; /* Location of the box */
    animation: fadeInModal 0.5s ease-out;
}

@keyframes fadeInModal {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: var(--container-bg);
    margin: auto;
    padding: 25px 20px;
    border: 1px solid var(--container-border);
    width: 95%;
    max-width: 650px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(var(--title-color-rgb, 255, 143, 223), 0.3); /* Shadow dengan warna tema */
    color: var(--text-color);
    position: relative;
    animation: slideInModal 0.5s ease-out;
}

@keyframes slideInModal {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


.modal-content h2 {
    color: var(--title-color);
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
    font-size: 1.6em;
}
.modal-content h2 .icon {
    font-size: 0.9em;
    vertical-align: middle;
}

.modal-content h3 {
    color: var(--accent-color);
    margin-top: 25px;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.modal-content p, .modal-content li {
    line-height: 1.7;
    font-size: 0.95em;
    color: var(--text-color);
    opacity: 0.9;
}
.modal-content ul {
    list-style-type: '✨ '; /* Custom bullet point */
    padding-left: 25px;
}
.modal-content li {
    margin-bottom: 8px;
}

.modal-content a {
    color: var(--download-btn-bg); /* Warna link seperti tombol download */
    text-decoration: none;
    font-weight: 500;
}
.modal-content a:hover {
    text-decoration: underline;
    color: var(--download-btn-hover);
}

.creator-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    background-color: rgba(255,255,255,0.05);
    padding: 15px 10px;
    border-radius: 10px;
}
.creator-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--accent-color);
}
.creator-info p {
    margin: 5px 0;
    font-size: 0.85em; /* Font deskripsi lebih kecil lagi */
    line-height: 1.5; /* Jaga keterbacaan dengan line-height yang cukup */
}

.creator-info p strong {
    font-size: 1em;
}

.modal-disclaimer {
    font-size: 0.85em !important;
    color: var(--placeholder-color) !important;
    margin-top: 30px;
    text-align: center;
    font-style: italic;
}

.close-modal-btn {
    color: var(--placeholder-color);
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 28px;
    font-weight: bold;
    transition: color 0.2s ease;
}

.close-modal-btn:hover,
.close-modal-btn:focus {
    color: var(--accent-color);
    text-decoration: none;
    cursor: pointer;
}

:root {
    --accent-color-rgb: 255, 105, 180; /* RGB values for accent color */
    --title-color-rgb: 255, 143, 223; /* RGB values for title color */
}