

.preview-box {
    position: relative;
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
}
.preview-box img {
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}
.preview-box .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,0,0,0.8);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 25px;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    color: #dc3545;
}
.ai-loader {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 30px auto;
}

/* Pulse warna biru-tech */
.ai-loader .pulse {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid rgba(0, 102, 255, 0.55);
    animation: pulseAnim 1.8s ease-out infinite;
}

/* Delay lingkaran ke-2 & ke-3 */
.ai-loader .pulse:nth-child(2) {
    animation-delay: 0.35s;
}
.ai-loader .pulse:nth-child(3) {
    animation-delay: 0.7s;
}

@keyframes pulseAnim {
    0% {
        transform: scale(0.25);
        opacity: 1;
        box-shadow: 0 0 10px rgba(0, 102, 255, 0.8);
    }
    60% {
        transform: scale(1.25);
        opacity: 0.25;
        box-shadow: 0 0 25px rgba(0, 102, 255, 0.4);
    }
    100% {
        transform: scale(1.35);
        opacity: 0;
    }
}

/* Teks AI futuristik */
.ai-text {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    letter-spacing: 0.7px;
    font-family: "Inter", "Segoe UI", sans-serif;

    /* subtle glowing glitch-blue effect */
    text-shadow: 0 0 6px rgba(0, 102, 255, 0.25);

    animation: aiGlow 1.6s ease-in-out infinite;
}

@keyframes aiGlow {
    0% { text-shadow: 0 0 4px rgba(0, 102, 255, 0.18); }
    50% { text-shadow: 0 0 10px rgba(0, 102, 255, 0.35); }
    100% { text-shadow: 0 0 4px rgba(0, 102, 255, 0.18); }
}
.badge-safe {
    background: #e8f7ff;
    color: #007bff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #b5dfff;
}

.badge-unsafe {
    background: #ffecec;
    color: #d62828;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #ffbcbc;
}

.panel {
    width: 100%;
    transition: 0.6s ease;
    position: relative;
}

/* HIDDEN DEFAULT */
.hidden {
  display: none;
  opacity: 0;
  pointer-events: none;
}

/* ACTIVE STATE */
.active {
  display: block;
  opacity: 1;
}

/* --- EXIT EFFECT (DIV 1 ANALYZING) --- */
.panel.exit {
    animation: aiExit 0.3s forwards ease;
}

@keyframes aiExit {
    0% {
        opacity: 1;
        filter: blur(0);
        transform: scale(1);
    }
    40% {
        opacity: 0.5;
        filter: blur(3px);
        transform: scale(0.97);
    }
    100% {
        opacity: 0;
        filter: blur(10px);
        transform: scale(0.85);
    }
}

/* --- ENTER EFFECT (DIV 2 RESULT) --- */
.panel.enter {
    animation: aiEnter 0.3s forwards ease-out;
}

@keyframes aiEnter {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
        filter: blur(8px);
    }
    40% {
        opacity: 0.7;
        transform: translateY(8px) scale(1.02);
        filter: blur(2px);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

/* TEXT STYLING */
.loading-text, .result-text {
    font-size: 20px;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    color: #333;
    letter-spacing: 0.8px;
}

/* AI Style */
.btn-ai-border {
    position: relative;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    background: #ffffff;
    color: #333333;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    z-index: 1;
    transition: 0.2s ease;
}

/* BORDER ANIMATED */
.badge-beta {
    background: #f7d519;
    color: #333;
    font-size: 10px;
    padding: 2px 6px;
    margin-left: 8px;
    border-radius: 5px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.btn-ai-border::before {
    content: "";
    position: absolute;
    inset: -3px; /* area border di luar button */
    border-radius: 14px;
    background: linear-gradient(
        10deg,
        #ff00f7,
        #00e1ff,
        #00ff85,
        #ffe600,
        #ff007c,
        #6ab1ff,
        #ff00f7
    );
    background-size: 300% 300%;
    animation: borderMove 4s linear infinite;
    z-index: -1;
}

/* overlay putih agar background tetap putih, border tetap terlihat */
.btn-ai-border::after {
    content: "";
    position: absolute;
    inset: 3px; /* membuat area dalam button */
    background: #ffffff;
    border-radius: 10px;
    z-index: -1;
}

/* Hover sedikit efek */
.btn-ai-border:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 12px rgba(0, 255, 255, 0.3);
}

@keyframes borderMove {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

#myCanvas, .canvas-container{
  display: none !important;
}

.generate-loader {
    position: relative;
    width: 100px;
    height: 100px;
    margin: 20px auto;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Orbit minimalis */
.generate-orbit {
    position: absolute;
    border-radius: 50%;
    border: 2px solid #ffe600; /* Gold */
    animation: spin 2.2s linear infinite;
}

/* Orbit 1 */
.generate-orbit.orbit-1 {
    width: 50px;
    height: 50px;
    border-top-color: #ffd700;
    border-right-color: transparent;
}

/* Orbit 2 */
.generate-orbit.orbit-2 {
    width: 80px;
    height: 80px;
    border-bottom-color: #ffd700; /* Teal */
    border-left-color: transparent;
    animation-duration: 3s;
    animation-direction: reverse;
}

/* Animasi */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(0.92);
    }
    50% {
        transform: scale(1.06);
    }
}

@keyframes scanline {
    0% { transform: translateX(-10%); opacity: 0.4; }
    50% { opacity: 1; }
    100% { transform: translateX(10%); opacity: 0.4; }
}
