/* --- Animasi Dasar --- */
/* PERBAIKAN: Kurung kurawal ekstra dihapus */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Pengaturan Body & Latar Belakang --- */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #000;
    color: #333;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    padding: 1rem;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* Kontainer Utama (Efek Kaca) */
.container {
    background-color: rgba(20, 20, 30, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 2.5rem 3rem; /* Padding sedikit dikurangi untuk HP */
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 600px; /* Sedikit lebih lebar untuk konten baru */
    text-align: center;
    box-sizing: border-box;
    animation: fadeIn 0.8s ease-out;
}

/* Teks dan Ikon (Warna Terang) */
h1 {
    font-weight: 600;
    font-size: 1.8rem;
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

p {
    font-weight: 300;
    color: #c0c0d0;
    margin-bottom: 1.5rem; /* Margin dikurangi */
    font-size: 1.1rem;
    line-height: 1.6;
}

.security-icon {
    width: 60px; /* Sedikit lebih kecil */
    height: 60px;
    color: #00aaff;
    margin-bottom: 1rem;
}

/* === GAYA FITUR BARU: SISTEM TAB === */
.tab-container {
    display: flex;
    margin-bottom: 2rem;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    padding: 5px;
}
.tab-btn {
    flex: 1;
    padding: 0.8rem 0.5rem;
    background: transparent;
    border: none;
    color: #aaa;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.tab-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
}
.tab-btn.active {
    background-color: #007bff;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}
.tab-btn i {
    margin-right: 8px;
}

/* Konten Tab */
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
    animation: slideIn 0.5s ease-out;
}


/* Form Input (Dark) */
#phishing-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

#url-input {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    background-color: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    border-radius: 10px;
    box-sizing: border-box;
    transition: border-color 0.3s, box-shadow 0.3s;
}

#url-input::placeholder {
    color: #777;
}

#url-input:focus {
    border-color: #00aaff;
    box-shadow: 0 0 0 4px rgba(0, 170, 255, 0.2);
    outline: none;
}

/* Tombol */
#check-button {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    color: #ffffff;
    background-image: linear-gradient(45deg, #007bff, #0056b3);
    background-size: 200% auto;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-position 0.4s, transform 0.2s;
}

#check-button:hover {
    background-position: right center;
}

#check-button:active {
    transform: scale(0.98);
}


/* === GAYA FITUR BARU: QR CODE INPUT === */
.qr-label {
    font-size: 1rem;
    color: #c0c0d0;
    margin-bottom: 1rem;
}
/* Sembunyikan input file asli */
#qr-file-input {
    display: none;
}
/* Buat label kustom yang terlihat seperti tombol */
.qr-file-label {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: #007bff;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s;
}
.qr-file-label:hover {
    background-color: #0056b3;
}
.qr-file-label i {
    margin-right: 8px;
}
#qr-file-name {
    display: block;
    margin-top: 1rem;
    color: #aaa;
    font-style: italic;
}


/* === GAYA FITUR BARU: Area Hasil (Wrapper) === */
#hasil-wrapper {
    margin-top: 2rem;
    text-align: left;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden; /* Agar anak-anaknya rapi */
}

/* 1. Kontainer Heuristik */
#heuristik-container {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
#heuristik-container h3 {
    margin: 0 0 1rem 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}
#heuristik-list {
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.95rem;
}
.heuristik-aman {
    color: #28a745; /* Hijau */
}
.heuristik-bahaya {
    color: #dc3545; /* Merah */
}
#heuristik-list li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}
#heuristik-list i {
    margin-right: 10px;
    width: 16px; /* Ratakan ikon */
}


/* 2. Area Hasil (Dark) */
#hasil-container {
    padding: 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    animation: slideIn 0.5s ease-out;
}
#hasil-container h3 {
    margin: 0 0 0.75rem 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}
#hasil-teks {
    margin: 0 0 1.5rem 0;
    font-size: 1.15rem; /* Sedikit lebih besar */
    line-height: 1.6;
}

/* Status Warna Hasil */
.loading #hasil-teks { color: #c0c0d0; }
.safe #hasil-teks { color: #28a745; } /* Hijau cerah */
.danger #hasil-teks { color: #dc3545; } /* Merah cerah */
/* Hapus background warna-warni, biarkan transparan */
.loading, .safe, .danger {
    background-color: transparent;
    border: none;
}


/* === GAYA FITUR BARU: Tombol Aksi (Salin & Lapor) === */
.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap; /* Untuk HP */
}
#salin-btn, #lapor-link {
    font-family: 'Poppins', sans-serif;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s, transform 0.2s;
    border: none;
}
#salin-btn {
    background-color: #007bff;
    color: white;
}
#salin-btn:hover {
    background-color: #0056b3;
}
#lapor-link {
    background-color: transparent;
    border: 1px solid #777;
    color: #aaa;
}
#lapor-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: #aaa;
    color: #fff;
}
.action-buttons i {
    margin-right: 8px;
}
#salin-btn:active, #lapor-link:active {
    transform: scale(0.98);
}


/* === GAYA FITUR BARU: Riwayat Pengecekan === */
#riwayat-wrapper {
    margin-top: 2rem;
    text-align: left;
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
}
#riwayat-wrapper h3 {
    margin: 0 0 1rem 0;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
}
#riwayat-wrapper h3 i {
    margin-right: 8px;
    color: #00aaff;
}
#riwayat-list {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
}
#riwayat-list li {
    display: flex; /* Gunakan flexbox */
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1rem;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    word-break: break-all;
}
#riwayat-list li:hover {
    background-color: rgba(255, 255, 255, 0.15);
}
.riwayat-url {
    font-weight: 500;
    color: #eee;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}
.riwayat-hasil {
    font-weight: 600;
    margin-right: 1rem;
}
.riwayat-tanggal {
    font-size: 0.8rem;
    color: #999;
}
/* Warna status riwayat */
.riwayat-aman .riwayat-hasil { color: #28a745; }
.riwayat-bahaya .riwayat-hasil { color: #dc3545; }
.riwayat-error .riwayat-hasil { color: #ffc107; }

#hapus-riwayat-btn {
    background: transparent;
    border: 1px solid #dc3545;
    color: #dc3545;
    padding: 0.5rem 1rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 1rem;
    transition: background-color 0.3s, color 0.3s;
}
#hapus-riwayat-btn:hover {
    background-color: #dc3545;
    color: white;
}


/* --- KODE BACKGROUND BINTANG ANDA (SUDAH DIPERBAIKI) --- */
.bg {
    background: url(https://i.ibb.co/87GbbFP/2799006.jpg) no-repeat;
    background-size: cover;
    height: 100%;
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: -3;
}
.bg:before {
    content: "";
    width: 100%;
    height: 100%;
    background: #000;
    position: fixed;
    z-index: -1;
    top: 0;
    left: 0;
    opacity: 0.7; /* Saya naikkan sedikit agar lebih gelap & teks lebih kontras */
}
@keyframes sf-fly-by-1 {
    from {
        transform: translateZ(-600px);
        opacity: 0.5;
    }
    to {
        transform: translateZ(0);
        opacity: 0.5;
    }
}
@keyframes sf-fly-by-2 {
    from {
        transform: translateZ(-1200px);
        opacity: 0.5;
    }
    to {
        transform: translateZ(-600px);
        opacity: 0.5;
    }
}
@keyframes sf-fly-by-3 {
    from {
        transform: translateZ(-1800px);
        opacity: 0.5;
    }
    to {
        transform: translateZ(-1200px);
        opacity: 0.5;
    }
}
.star-field {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    perspective: 600px;
    -webkit-perspective: 600px;
    z-index: -1;
}
.star-field .layer {
    /* PERBAIKAN: Kode box-shadow Anda yang rusak telah diperbaiki & digabung */
    box-shadow: -411px -476px #cccccc, 777px -407px #d4d4d4, -387px -477px #fcfcfc, -91px -235px #d4d4d4, 491px -460px #f7f7f7, 892px -128px #f7f7f7, 758px -277px #ededed, 596px 378px #cccccc, 647px 423px whitesmoke, 183px 389px #c7c7c7, 524px -237px #f0f0f0, 679px -535px #e3e3e3, 158px 399px #ededed, 157px 249px #ededed, 81px -450px #ebebeb, 719px -360px #c2c2c2, -499px 473px #e8e8e8, -158px -349px #d4d4d4, 870px -134px #cfcfcf, 446px 404px #c2c2c2, 440px 490px #d4d4d4, 414px 507px #e6e6e6, -12px 246px #fcfcfc, -384px 369px #e3e3e3, 641px -413px #fcfcfc, 822px 516px #dbdbdb, 449px 132px #c2c2c2, 727px 146px #f7f7f7, -315px -488px #e6e6e6, 952px -70px #e3e3e3, -869px -29px #dbdbdb, 502px 80px #dedede, 764px 342px #e0e0e0, -150px -380px #dbdbdb, 654px -426px #e3e3e3, -325px -263px #c2c2c2, 755px -447px #c7c7c7, 729px -177px #c2c2c2, -682px -391px #e6e6e6, 554px -176px #ededed, -85px -428px #d9d9d9, 714px 55px #e8e8e8, 359px -285px #cfcfcf, -362px -508px #dedede, 468px -265px #fcfcfc, 74px -500px #c7c7c7, -514px 383px #dbdbdb, 730px -92px #cfcfcf, -112px 287px #c9c9c9, -853px 79px #d6d6d6, 828px 475px #d6d6d6, -681px 13px #fafafa, -176px 209px #f0f0f0, 758px 457px #fafafa, -383px -454px #ededed, 813px 179px #d1d1d1, 608px 98px whitesmoke, -860px -65px #c4c4c4, -572px 272px #f7f7f7, 459px 533px #fcfcfc, 624px -481px #e6e6e6, 790px 477px #dedede, 731px -403px #ededed, 70px -534px #cccccc, -23px 510px #cfcfcf, -652px -237px whitesmoke, -690px 367px #d1d1d1, 810px 536px #d1d1d1, 774px 293px #c9c9c9, -362px 97px #c2c2c2, 563px 47px #dedede, 313px 475px #e0e0e0, 839px -491px #e3e3e3, -217px 377px #d4d4d4, -581px 239px #c2c2c2, -857px 72px #cccccc, -23px 340px #dedede, -837px 246px white, 170px -502px #cfcfcf, 822px -443px #e0e0e0, 795px 497px #e0e0e0, -814px -337px #cfcfcf, 206px -339px #f2f2f2, -779px 108px #e6e6e6, 808px 2px #d4d4d4, 665px 41px #d4d4d4, -564px 64px #cccccc, -380px 74px #cfcfcf, -369px -60px #f7f7f7, 47px -495px #e3e3e3, -383px 368px #f7f7f7, 419px 288px #d1d1d1, -598px -50px #c2c2c2, -833px 187px #c4c4c4, 378px 325px whitesmoke, -703px 375px #d6d6d6, 392px 520px #d9d9d9, -492px -60px #c4c4c4, 759px 288px #ebebeb, 98px -412px #c4c4c4, -911px -277px #c9c9c9;
    transform-style: preserve-3d;
    position: absolute;
    top: 50%;
    left: 50%;
    height: 4px;
    width: 4px;
    border-radius: 2px;
}
.star-field .layer:nth-child(1) {
    animation: sf-fly-by-1 5s linear infinite;
}
.star-field .layer:nth-child(2) {
    animation: sf-fly-by-2 5s linear infinite;
}
.star-field .layer:nth-child(3) {
    animation: sf-fly-by-3 5s linear infinite;
}

/* Responsif untuk HP */
@media (max-width: 600px) {
    .container {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    h1 {
        font-size: 1.6rem;
    }
    .tab-btn {
        font-size: 0.9rem;
    }
    .riwayat-list li {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    .riwayat-url {
        white-space: normal; /* Biarkan URL wrap */
    }
}