@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Noto+Sans+Devanagari:wght@400;500;600;700&display=swap');

:root {
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-border: #c7d2fe;
  
  --secondary: #0284c7;
  --success: #059669;
  --success-light: #ecfdf5;
  --warning: #d97706;
  --warning-light: #fffbeb;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border: #e2e8f0;
  --border-focus: #818cf8;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.07);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.05);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  
  --font-family: 'Inter', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  padding-bottom: 60px;
}

/* Header */
.navbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 16px 24px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-icon {
  width: 42px;
  height: 42px;
  background: linear-gradient(135deg, #4f46e5, #06b6d4);
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

.brand-text h1 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  letter-spacing: -0.01em;
}

.brand-text p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-actions {
  display: flex;
  gap: 12px;
}

.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-icon:hover {
  background: var(--bg-main);
  color: var(--text-main);
  border-color: var(--text-light);
}

/* Main Container */
.container {
  max-width: 1200px;
  margin: 32px auto;
  padding: 0 20px;
}

/* Layout Grid */
.layout-grid {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 28px;
  align-items: start;
}

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

/* Card Container */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
  transition: box-shadow 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-main);
}

/* Upload Dropzone */
.dropzone {
  border: 2px dashed var(--primary-border);
  background: var(--primary-light);
  border-radius: var(--radius-md);
  padding: 36px 20px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: #e0e7ff;
  transform: translateY(-2px);
}

.dropzone-icon {
  font-size: 40px;
  margin-bottom: 10px;
  display: block;
}

.dropzone-text {
  font-weight: 600;
  color: var(--primary-hover);
  margin-bottom: 4px;
  font-size: 1rem;
}

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

/* Camera button option */
.upload-buttons {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.btn-secondary {
  flex: 1;
  background: white;
  border: 1px solid var(--border);
  color: var(--text-main);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}

.btn-secondary:hover {
  background: #f1f5f9;
  border-color: var(--text-light);
}

/* Previews Grid */
.preview-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.preview-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.preview-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  background: rgba(220, 38, 38, 0.9);
  color: white;
  border: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Forms */
.form-group {
  margin-top: 18px;
}

.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Primary Button */
.btn-primary {
  width: 100%;
  background: linear-gradient(135deg, #4f46e5, #4338ca);
  color: white;
  border: none;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
  transition: all 0.25s ease;
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #4338ca, #3730a3);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Results Showcase */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.8;
}

/* Metadata Chips Bar */
.meta-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.meta-chip {
  background: var(--bg-main);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.meta-chip-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-bottom: 4px;
}

.meta-chip-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

/* Content Sections */
.section-block {
  margin-bottom: 28px;
}

.section-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 0.95rem;
  color: #1e293b;
  white-space: pre-wrap;
}

/* Topic Tags */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag {
  background: var(--primary-light);
  color: var(--primary-hover);
  border: 1px solid var(--primary-border);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
}

/* Difficulties */
.difficulty-item {
  background: var(--warning-light);
  border-left: 4px solid var(--warning);
  padding: 10px 14px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 0.92rem;
  color: #78350f;
}

/* Vague Statements Amplification Card */
.reflection-card {
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.reflection-original {
  font-size: 0.95rem;
  font-weight: 600;
  color: #c2410c;
  margin-bottom: 8px;
  background: #fff7ed;
  padding: 6px 10px;
  border-radius: 6px;
  display: inline-block;
}

.reflection-critique {
  font-size: 0.88rem;
  color: #7c2d12;
  margin-bottom: 8px;
}

.reflection-prompt {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  color: #1e3a8a;
  font-weight: 500;
}

/* Student Observations Cards */
.obs-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.obs-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #e2e8f0;
  color: #334155;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
}

.obs-body h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
}

.obs-body p {
  font-size: 0.92rem;
  color: #334155;
}

/* Copy Button */
.btn-copy {
  font-size: 0.75rem;
  padding: 4px 8px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-muted);
}

.btn-copy:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* Spinner */
.spinner {
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Modal */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: white;
  border-radius: var(--radius-lg);
  padding: 24px;
  max-width: 500px;
  width: 90%;
  box-shadow: var(--shadow-xl);
}

/* Print Styling */
@media print {
  .navbar, .layout-grid > div:first-child, .btn-primary, .btn-icon, .btn-copy, .upload-buttons {
    display: none !important;
  }
  .layout-grid {
    display: block !important;
  }
  .container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
}
