:root {
  --primary: #f8c045;
  --primary-hover: #e8af32;
  --bg-gradient: linear-gradient(-45deg, #ee7752, #e73c7e, #23a6d5, #23d5ab);
  --text-main: #ffffff;
  --text-muted: #e2e8f0;
  --glass-bg: rgba(25, 25, 35, 0.6);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --success: #10b981;
  --success-hover: #059669;
}

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

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: var(--text-main);
  background: var(--bg-gradient);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
}

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

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 24px;
  padding: 32px;
  width: 90%;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(40px); }
  to { opacity: 1; transform: translateY(0); }
}

.header {
  text-align: center;
}

.header h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.header .subtitle {
  font-size: 14px;
  color: var(--text-muted);
}

.api-selector-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.2);
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 14px;
}

.glass-input {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: white;
  padding: 6px 12px;
  border-radius: 8px;
  outline: none;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
}

.glass-input option {
  background: #2a2a35;
  color: white;
}

.drop-zone {
  border: 2px dashed rgba(255,255,255,0.3);
  border-radius: 16px;
  padding: 32px 20px;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
  background: rgba(0,0,0,0.1);
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--primary);
  background: rgba(248, 192, 69, 0.05);
}

.drop-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.drop-content svg {
  color: rgba(255,255,255,0.6);
  transition: transform 0.3s ease;
}

.drop-zone:hover .drop-content svg {
  transform: scale(1.1);
  color: var(--primary);
}

.drop-content p {
  font-size: 15px;
  font-weight: 500;
}

.drop-content p span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.btn {
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 12px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.97);
}

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

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

.primary-btn {
  background: var(--primary);
  color: #111;
  box-shadow: 0 4px 15px rgba(248, 192, 69, 0.3);
}

.primary-btn:hover {
  background: var(--primary-hover);
  box-shadow: 0 6px 20px rgba(248, 192, 69, 0.4);
}

.success-btn {
  background: var(--success);
  color: white;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.success-btn:hover {
  background: var(--success-hover);
}

.hidden {
  display: none !important;
}

#imagePreviewContainer, #resultContainer {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: center;
  width: 100%;
}

.image-preview {
  max-width: 100%;
  max-height: 250px;
  border-radius: 12px;
  object-fit: contain;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.1);
  background-color: transparent;
}

.result-image {
  background: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAMUlEQVQ4T2NkYNgfQEhgYmBwwAhlho4GjBqAMQ0YDAeDDAWDMQ8YPAZDAwYJhhNwgQEAzGweJ1tTf2AAAAAASUVORK5CYII=');
}

.loader-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 0;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255,255,255,0.2);
  border-left-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

#statusMsg {
  font-size: 14px;
  color: var(--text-muted);
}

.footer {
  margin-top: 40px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  background: linear-gradient(90deg, #fff, #f8c045, #ff00ea, #fff);
  background-size: 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: 
    flowText 4s linear infinite,
    blinkGlow 2s ease-in-out infinite alternate,
    float 3s ease-in-out infinite;
  text-shadow: 0 0 10px rgba(248, 192, 69, 0.2);
}

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

@keyframes blinkGlow {
  from { opacity: 0.6; filter: drop-shadow(0 0 2px rgba(255,255,255,0.4)); }
  to { opacity: 1; filter: drop-shadow(0 0 15px rgba(248, 192, 69, 0.8)); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

