/* Mengimpor font modern dari Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700&display=swap');

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  /* Latar belakang gradasi yang modern */
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding: 20px;
}

.container {
  background: #ffffff;
  padding: 40px 30px;
  border-radius: 20px;
  width: 100%;
  max-width: 450px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
}

/* --- ANIMASI MUNCUL --- */
.fade-in {
  animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- TIPOGRAFI --- */
h2 {
  color: #1e293b;
  margin-bottom: 8px;
}

.subtitle {
  color: #64748b;
  font-size: 0.9rem;
  margin-bottom: 25px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

/* --- INPUT & BUTTON --- */
input {
  width: 100%;
  padding: 15px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  font-size: 1rem;
  transition: all 0.3s ease;
  outline: none;
}

input:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

button {
  padding: 15px;
  background: #3b82f6;
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

button:hover {
  background: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

button:disabled {
  background: #94a3b8;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* --- ANIMASI LOADING --- */
#loading {
  margin-top: 25px;
  color: #475569;
  font-size: 0.95rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid #3b82f6;
  border-radius: 50%;
  margin: 0 auto 10px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* --- HASIL SCAN --- */
#result {
  margin-top: 25px;
  padding: 0; 
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #334155;
  text-align: left;
  line-height: 1.6;
  animation: fadeIn 0.5s ease-out;
  overflow: hidden; 
}

.hidden {
  display: none !important;
}

/* --- FOOTER & WATERMARK --- */
.footer {
  margin-top: 30px;
  font-size: 0.85rem;
  color: #94a3b8;
}

.footer strong {
  color: #3b82f6;
}

/* --- GAYA KHUSUS UNTUK HASIL SCAN AI --- */
.result-header {
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid #e2e8f0;
}

.result-icon {
  font-size: 2.5rem;
  margin-bottom: -5px;
}

.result-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
}

.score-badge {
  background: rgba(255, 255, 255, 0.9);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.result-reason {
  padding: 20px;
  margin: 0;
  color: #475569;
}

/* --- KELAS WARNA DINAMIS --- */
.safe {
  background: #dcfce7;
  color: #166534;
}

.warning {
  background: #fef08a;
  color: #854d0e;
}

.danger {
  background: #fee2e2;
  color: #991b1b;
}