:root {
  --bg-color: #0f172a;
  --panel-bg: rgba(30, 41, 59, 0.7);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --hotdog-color: #22c55e;
  --not-hotdog-color: #ef4444;
  --custom-color: #8b5cf6;
  --border-color: rgba(255, 255, 255, 0.1);
  --font-main: 'Outfit', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: radial-gradient(circle at top right, #1e293b, var(--bg-color));
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-container {
  width: 100%;
  max-width: 600px;
  padding: 2rem;
}

header {
  text-align: center;
  margin-bottom: 2.5rem;
}

h1 {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: -1px;
}

h1 span {
  color: var(--accent);
}

.subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.panel {
  background: var(--panel-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

h2 {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.instruction {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.api-steps {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-left: 1.5rem;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}

.api-steps a {
  color: var(--accent);
  text-decoration: none;
}

.api-steps a:hover {
  text-decoration: underline;
}

.input-group {
  display: flex;
  gap: 0.5rem;
}

input[type="password"],
input[type="text"] {
  flex: 1;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 0.8rem 1rem;
  color: white;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}

input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  font-family: inherit;
  font-weight: 600;
  padding: 0.8rem 1.5rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 1rem;
}

.btn.primary {
  background: var(--accent);
  color: white;
  width: 100%;
  margin-top: 1rem;
}

.btn.primary:hover:not(.disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
}

.btn.primary.disabled {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.3);
  cursor: not-allowed;
}

.btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn.text-btn {
  background: transparent;
  color: var(--text-secondary);
  width: 100%;
  margin-top: 0.5rem;
}

.btn.text-btn:hover {
  color: white;
  text-decoration: underline;
}

.status-message {
  font-size: 0.85rem;
  margin-top: 0.5rem;
  min-height: 1.2rem;
}

.status-message.success {
  color: var(--hotdog-color);
}

.drop-zone {
  border: 2px dashed var(--border-color);
  border-radius: 12px;
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: rgba(0, 0, 0, 0.1);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--accent);
  background: rgba(59, 130, 246, 0.05);
}

.drop-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  display: block;
}

.drop-zone p {
  color: var(--text-secondary);
  font-weight: 600;
}

.preview-container {
  text-align: center;
}

.preview-container.hidden {
  display: none;
}

#image-preview {
  max-width: 100%;
  max-height: 300px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
  margin-bottom: 1rem;
}

/* History Section */
.history-section.hidden {
  display: none;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.history-item {
  display: flex;
  align-items: center;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  padding: 0.8rem;
  gap: 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.history-thumb {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

.history-result {
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.history-result.hotdog {
  background: rgba(34, 197, 94, 0.15);
  color: var(--hotdog-color);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.history-result.nothotdog {
  background: rgba(239, 68, 68, 0.15);
  color: var(--not-hotdog-color);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.history-result.custom {
  background: rgba(139, 92, 246, 0.15);
  color: var(--custom-color);
  border: 1px solid rgba(139, 92, 246, 0.3);
}

/* Result Overlay */
.result-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: opacity 0.3s ease;
}

.result-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.result-overlay.hotdog {
  background: rgba(34, 197, 94, 0.85); /* Green */
}

.result-overlay.nothotdog {
  background: rgba(239, 68, 68, 0.85); /* Red */
}

.result-overlay.custom {
  background: rgba(139, 92, 246, 0.85); /* Purple */
}

.result-overlay.custom #result-text {
  font-size: 3rem;
  padding: 0 2rem;
}

.result-content {
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.result-overlay:not(.hidden) .result-content {
  transform: scale(1);
}

#result-text {
  font-size: 5rem;
  color: white;
  text-transform: uppercase;
  margin-bottom: 2rem;
  text-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.btn.overlay-btn {
  background: white;
  color: black;
  font-size: 1.2rem;
}

.btn.overlay-btn:hover {
  background: rgba(255, 255, 255, 0.9);
  transform: scale(1.05);
}

/* Loading */
.loading-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(15, 23, 42, 0.9);
  z-index: 50;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-left-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 1.5rem;
}

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