/* ==========================================================================
   AI MAGIC FILTER LAB - Stylesheet
   ========================================================================== */

:root {
  --primary: #4F46E5;
  --primary-hover: #4338CA;
  --secondary: #06B6D4;
  --accent: #F59E0B;
  --success: #10B981;
  --danger: #EF4444;
  --bg-gradient: linear-gradient(135deg, #EEF2FF 0%, #E0E7FF 50%, #F0F9FF 100%);
  --card-bg: #FFFFFF;
  --text-main: #1E293B;
  --text-muted: #64748B;
  --border-radius: 20px;
  --shadow-soft: 0 10px 25px -5px rgba(79, 70, 229, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.05);
  --font-heading: 'Fredoka', cursive, sans-serif;
  --font-body: 'Quicksand', sans-serif;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg-gradient);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 2rem;
  line-height: 1.5;
}

/* Header */
.app-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: 1.25rem 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid rgba(224, 231, 255, 0.8);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.logo-container {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.logo-badge {
  font-family: var(--font-heading);
  background: #EEF2FF;
  color: var(--primary);
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 700;
  width: fit-content;
}

.logo-title {
  font-family: var(--font-heading);
  font-size: 1.8rem;
  color: var(--primary);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.badge {
  padding: 8px 16px;
  border-radius: 30px;
  font-weight: 700;
  font-size: 0.9rem;
}

.status-badge {
  background: #FEF3C7;
  color: #B45309;
  border: 1px solid #FDE68A;
}

.status-badge.ready {
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}

.api-btn {
  background: #EEF2FF;
  color: var(--primary);
  border: 1px solid #C7D2FE;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
}

.api-btn:hover {
  background: #E0E7FF;
}

/* Main Layout */
.main-layout {
  max-width: 1280px;
  width: 92%;
  margin: 2rem auto;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

/* CTA Registration Banner */
.cta-banner-card {
  background: linear-gradient(135deg, #F59E0B 0%, #EA580C 100%);
  border-radius: var(--border-radius);
  padding: 1.25rem 2rem;
  color: #FFFFFF;
  box-shadow: 0 10px 25px -5px rgba(234, 88, 12, 0.3);
}

.cta-content {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.cta-icon {
  font-size: 2.8rem;
  background: rgba(255, 255, 255, 0.2);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cta-text h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.cta-text p {
  font-size: 1.1rem;
  font-weight: 500;
  color: #FEF3C7;
}

.cta-text strong {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Grid Layout */
.workspace-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.75rem;
}

@media (max-width: 900px) {
  .workspace-grid {
    grid-template-columns: 1fr;
  }
}

.card-shadow {
  background: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 1.75rem;
  box-shadow: var(--shadow-soft);
}

.card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-main);
  margin-bottom: 1rem;
}

.section-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
}

/* Prompt Input */
.prompt-box-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

#prompt-input {
  font-family: var(--font-body);
  font-size: 1.05rem;
  padding: 1rem;
  border: 2px solid #E2E8F0;
  border-radius: 16px;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s ease;
}

#prompt-input:focus {
  border-color: var(--primary);
}

.hero-btn {
  background: linear-gradient(135deg, #4F46E5 0%, #4338CA 100%);
  color: #FFFFFF;
  padding: 12px 24px;
  font-size: 1.1rem;
  border-radius: 16px;
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

.hero-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(79, 70, 229, 0.45);
}

/* Inspiration Pills */
.inspiration-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.inspiration-label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.inspiration-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill-btn {
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
}

.pill-btn:hover {
  background: #EEF2FF;
  border-color: var(--primary);
  color: var(--primary);
}

/* Spec Inspector */
.spec-inspector {
  background: #0F172A;
  color: #38BDF8;
  border-radius: 16px;
  padding: 1rem;
  font-family: monospace;
  font-size: 0.85rem;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  padding-bottom: 0.5rem;
  margin-bottom: 0.5rem;
  color: #94A3B8;
}

.spec-badge {
  background: rgba(56, 189, 248, 0.2);
  color: #38BDF8;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
}

#spec-code-block {
  max-height: 180px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* Camera & Canvas Wrapper */
.canvas-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #0F172A;
  border-radius: 16px;
  overflow: hidden;
  border: 3px solid #E2E8F0;
}

#filter-canvas {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.cam-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.85);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
}

.secondary-btn {
  background: #E2E8F0;
  color: var(--text-main);
  padding: 8px 16px;
}

.secondary-btn:hover {
  background: #CBD5E1;
}

button {
  font-family: var(--font-heading);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-card {
  background: #FFFFFF;
  border-radius: 20px;
  padding: 2rem;
  max-width: 450px;
  width: 90%;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.modal-card h2 {
  font-family: var(--font-heading);
  color: var(--primary);
}

.modal-input {
  padding: 0.75rem 1rem;
  border: 2px solid #E2E8F0;
  border-radius: 12px;
  font-size: 1rem;
}

.modal-actions {
  display: flex;
  gap: 1rem;
}

.app-footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: auto;
}
