/* ============================================================
   style.css — Main stylesheet
   ============================================================
   Imports all CSS modules and defines the page-level layout.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('./css/variables.css');
@import url('./css/animations.css');
@import url('./css/components.css');
@import url('./css/responsive.css');

/* ── Global reset ────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background: var(--bg-base);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;

  /* Subtle background gradient */
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(16, 185, 129, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(59, 130, 246, 0.04) 0%, transparent 50%);
}

/* ── App header ──────────────────────────────────────────── */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-6);
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: var(--z-dropdown);
}

.app-header .logo {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.app-header .logo-icon {
  font-size: 1.8rem;
}

.app-header h1 {
  font-size: var(--font-size-xl);
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--font-size-sm);
  color: var(--text-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--text-muted);
}

.status-dot.status-healthy  { background: var(--color-success); box-shadow: 0 0 6px var(--color-success); }
.status-dot.status-error    { background: var(--color-danger); }
.status-dot.status-checking { background: var(--color-warning); animation: pulse 1s infinite; }

/* ── App container ───────────────────────────────────────── */
.app-container {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-6);
}

/* ── Section titles ──────────────────────────────────────── */
.section-title {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}

.section-subtitle {
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  margin-bottom: var(--space-6);
}

/* ── Camera section ──────────────────────────────────────── */
.camera-section {
  margin-bottom: var(--space-8);
}

.camera-wrapper {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  border: 2px solid var(--border-color);
  background: #000;
  aspect-ratio: 4 / 3;
}

.camera-wrapper video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.camera-wrapper .captured-preview {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 120px;
  height: 90px;
  border-radius: var(--radius-md);
  border: 2px solid var(--color-primary);
  object-fit: cover;
  display: none;
  box-shadow: var(--shadow-lg);
}

/* ── Controls bar ────────────────────────────────────────── */
.controls-bar {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-top: var(--space-4);
  flex-wrap: wrap;
}

/* ── Question input ──────────────────────────────────────── */
.question-section {
  margin-bottom: var(--space-6);
}

.question-input-wrapper {
  position: relative;
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.question-input-wrapper textarea {
  flex: 1;
  padding: var(--space-3) var(--space-4);
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  resize: none;
  min-height: 48px;
  max-height: 120px;
  transition: border-color var(--transition-fast);
}

.question-input-wrapper textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-glow);
}

.question-input-wrapper textarea::placeholder {
  color: var(--text-muted);
}

/* ── Upload zone ─────────────────────────────────────────── */
.upload-section {
  margin-top: var(--space-4);
}

/* ── Response area ───────────────────────────────────────── */
.response-area {
  margin-top: var(--space-6);
}

.response-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.diagnosis-details {
  margin-bottom: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
}

.diagnosis-details p {
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
}

.treatments-section {
  margin: var(--space-4) 0;
}

.treatment-item {
  padding: var(--space-3);
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-2);
  font-size: var(--font-size-sm);
  border-left: 3px solid var(--color-primary);
}

.advice-section {
  margin-top: var(--space-4);
}

.advice-text {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  color: var(--text-secondary);
}

.advice-text strong {
  color: var(--text-primary);
}

.web-search-note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-4);
  padding: var(--space-2) var(--space-3);
  background: rgba(59, 130, 246, 0.1);
  border-radius: var(--radius-md);
  font-size: var(--font-size-xs);
  color: var(--color-info);
}

/* ── Text utilities ──────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-primary  { color: var(--color-primary); }
.text-center   { text-align: center; }

/* ── Hidden file input ───────────────────────────────────── */
input[type="file"] {
  display: none;
}
