/* Import Outfit and Inter fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --bg-primary: #060913;
  --bg-secondary: #0d1224;
  --bg-card: rgba(17, 25, 46, 0.75);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(59, 130, 246, 0.3);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --color-primary: #3b82f6;
  --color-primary-glow: rgba(59, 130, 246, 0.15);
  --color-secondary: #a855f7;
  
  --color-real: #10b981;
  --color-real-glow: rgba(16, 185, 129, 0.2);
  --color-fake: #f43f5e;
  --color-fake-glow: rgba(244, 63, 94, 0.2);
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.08) 0%, transparent 40%);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
  overflow-x: hidden;
}

header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: rgba(6, 9, 19, 0.8);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.4);
}

.logo-text {
  font-family: var(--font-title);
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(to right, #ffffff, #93c5fd);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -0.025em;
}

.logo-badge {
  font-size: 0.7rem;
  font-weight: 600;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.3);
  color: #60a5fa;
  padding: 0.15rem 0.5rem;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

main {
  flex: 1;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 3rem 1.5rem;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 2rem;
}

@media (max-width: 968px) {
  main {
    grid-template-columns: 1fr;
  }
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #ffffff, #d1d5db);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

/* Glass Card Design */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--transition-smooth);
}

.card:hover {
  border-color: rgba(255, 255, 255, 0.15);
}

/* Uploader Dropzone */
.dropzone-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 1rem;
  padding: 4rem 2rem;
  text-align: center;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.01);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(59, 130, 246, 0.03);
  box-shadow: 0 0 20px var(--color-primary-glow);
}

.dropzone-icon {
  width: 4rem;
  height: 4rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  transition: var(--transition-smooth);
}

.dropzone:hover .dropzone-icon {
  color: var(--color-primary);
  transform: translateY(-5px);
}

.dropzone-text {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.dropzone-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Image Preview Container */
.preview-container {
  display: none;
  position: relative;
  border-radius: 1rem;
  overflow: hidden;
  border: 1px solid var(--border-color);
  aspect-ratio: 16 / 9;
  background: #000;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.remove-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: var(--transition-smooth);
  z-index: 10;
}

.remove-btn:hover {
  background: var(--color-fake);
  color: white;
  border-color: transparent;
  transform: scale(1.1);
}

/* Action Buttons */
.btn-group {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.btn {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1.75rem;
  border-radius: 0.75rem;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  flex: 1;
}

.btn-primary {
  background: linear-gradient(135deg, var(--color-primary), #1d4ed8);
  color: white;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5);
  background: linear-gradient(135deg, #2563eb, #1e40af);
}

.btn-primary:disabled {
  background: #1e293b;
  color: var(--text-muted);
  cursor: not-allowed;
  box-shadow: none;
}

/* Results Panel styling */
.results-panel {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  height: 100%;
}

.results-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 350px;
  color: var(--text-muted);
  text-align: center;
  border: 1px dashed var(--border-color);
  border-radius: 1rem;
  padding: 2rem;
}

.results-placeholder svg {
  width: 3.5rem;
  height: 3.5rem;
  margin-bottom: 1rem;
  color: var(--text-muted);
  opacity: 0.5;
}

.results-content {
  display: none;
  animation: fadeIn 0.5s ease;
}

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

.result-card {
  border-radius: 1rem;
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

.result-card.is-real {
  background: var(--color-real-glow);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.result-card.is-real::before {
  background: var(--color-real);
}

.result-card.is-fake {
  background: var(--color-fake-glow);
  border: 1px solid rgba(244, 63, 94, 0.3);
}

.result-card.is-fake::before {
  background: var(--color-fake);
}

.result-badge {
  font-family: var(--font-title);
  font-size: 2.25rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
  display: block;
}

.result-card.is-real .result-badge {
  color: #34d399;
  text-shadow: 0 0 15px rgba(52, 211, 153, 0.4);
}

.result-card.is-fake .result-badge {
  color: #fb7185;
  text-shadow: 0 0 15px rgba(251, 113, 133, 0.4);
}

.result-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Confidence Meter */
.confidence-container {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
}

.confidence-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.confidence-title {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.confidence-value {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
}

.confidence-bar-bg {
  height: 0.75rem;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  overflow: hidden;
}

.confidence-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.8s cubic-bezier(0.1, 0.8, 0.25, 1);
}

.is-real .confidence-bar-fill {
  background: linear-gradient(90deg, #10b981, #34d399);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
}

.is-fake .confidence-bar-fill {
  background: linear-gradient(90deg, #f43f5e, #fb7185);
  box-shadow: 0 0 10px rgba(251, 113, 133, 0.5);
}

/* Loading States */
.loading-overlay {
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  height: 100%;
  min-height: 350px;
}

.spinner {
  width: 3.5rem;
  height: 3.5rem;
  border: 4px solid rgba(59, 130, 246, 0.1);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-text {
  font-size: 1.1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* Pipeline Retraining Card */
.pipeline-card {
  margin-top: 2rem;
  background: linear-gradient(to bottom right, rgba(13, 18, 36, 0.6), rgba(6, 9, 19, 0.8));
  border: 1px solid var(--border-color);
  border-radius: 1rem;
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

@media (max-width: 640px) {
  .pipeline-card {
    flex-direction: column;
    align-items: flex-start;
  }
  .pipeline-card button {
    width: 100%;
  }
}

.pipeline-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.pipeline-title {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
}

.pipeline-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

.btn-secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Status Notifications */
.notification {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
  padding: 1rem 1.5rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
  display: none;
  align-items: center;
  gap: 0.75rem;
  z-index: 1000;
  animation: slideIn 0.3s ease;
  max-width: 400px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.notification.success {
  border-left: 4px solid var(--color-real);
}

.notification.error {
  border-left: 4px solid var(--color-fake);
}

.notification-message {
  font-size: 0.9rem;
  font-weight: 500;
}

footer {
  text-align: center;
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-muted);
  background: rgba(6, 9, 19, 0.9);
}

footer a {
  color: var(--color-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

footer a:hover {
  text-decoration: underline;
}
