/* ==========================================================================
   CropDisease-KG — Material Design Theme (Roboto + Deep Orange Accent)
   ========================================================================== */

:root {
  --md-bg: #f5f5f5;
  --md-surface: #ffffff;
  --md-appbar: #212121;
  --md-primary: #e65100;
  --md-primary-dark: #bf360c;
  --md-primary-soft: #fff3e0;
  --md-text: #212121;
  --md-text-secondary: #616161;
  --md-divider: #e0e0e0;

  /* Semantic entity colors */
  --crop: #2e7d32;
  --disease: #c62828;
  --pathogen: #ef6c00;
  --symptom: #1565c0;
  --control: #00695c;

  /* Material elevations */
  --md-elev-1: 0 1px 3px rgba(0, 0, 0, 0.10), 0 1px 2px rgba(0, 0, 0, 0.06);
  --md-elev-2: 0 3px 6px rgba(0, 0, 0, 0.12), 0 2px 4px rgba(0, 0, 0, 0.08);
  --md-elev-4: 0 8px 20px rgba(0, 0, 0, 0.16), 0 2px 6px rgba(0, 0, 0, 0.10);

  --control-h: 44px;
  --control-h-sm: 38px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  height: 100%;
  font-size: 16px;
}

body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  color: var(--md-text);
  background: var(--md-bg);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

code,
pre,
#sparql-editor {
  font-family: "Roboto Mono", Consolas, Menlo, Monaco, monospace;
}

h2 {
  margin: 0 0 8px 0;
  font-size: 1.65rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}

h3 {
  margin: 0 0 10px 0;
  font-size: 1.22rem;
  font-weight: 500;
}

h4 {
  margin: 0 0 6px 0;
  font-size: 1.06rem;
  font-weight: 500;
}

p {
  margin: 0 0 10px 0;
  font-size: 0.96rem;
}

.text-secondary {
  color: var(--md-text-secondary);
}

.small-note {
  font-size: 0.9rem;
}

.material-symbols-outlined {
  font-size: 20px;
  line-height: 1;
  vertical-align: middle;
}

/* ==========================================================================
   Tab Panels (Pure Fade Transition) & Layout Containers
   ========================================================================== */

.tab-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow: auto;
}

.tab-panel.active {
  display: flex;
  flex-direction: column;
  animation: md-fade 0.2s ease;
}

@keyframes md-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.page-container {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
  padding: 24px 28px 40px;
}

.stack-lg { display: flex; flex-direction: column; gap: 20px; }
.stack-md { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }

/* ==========================================================================
   Footer & Material Snackbar
   ========================================================================== */

.md-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 12px 24px;
  background: var(--md-appbar);
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.875rem;
  flex-shrink: 0;
}

.footer-left,
.footer-links {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.footer-left strong {
  color: #ffffff;
}

.footer-link {
  padding: 2px 4px;
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.9);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
}

.footer-link:hover {
  color: #ffab40;
  text-decoration: underline;
}

.footer-meta {
  padding-left: 10px;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.snackbar-container {
  position: fixed;
  right: 24px;
  bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 100;
  pointer-events: none;
}

/* Page Transition Loading Spinner Overlay */
.page-loader {
  position: fixed;
  inset: 60px 0 42px 0;
  background: rgba(245, 245, 245, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.14s ease;
}

.page-loader.visible {
  opacity: 1;
  pointer-events: auto;
}

.page-loader-spinner {
  width: 36px;
  height: 36px;
  border: 3.5px solid #ffe0b2;
  border-top-color: var(--md-primary);
  border-radius: 50%;
  animation: md-spin 0.65s linear infinite;
}

.toast {
  pointer-events: auto;
  min-width: 280px;
  max-width: 420px;
  padding: 14px 16px;
  border-radius: 4px;
  background: #323232;
  color: #ffffff;
  font-size: 0.875rem;
  box-shadow: var(--md-elev-4);
  border-left: 4px solid #4caf50;
  animation: md-fade 0.2s ease;
}

.toast.toast-error {
  border-left-color: #f44336;
}

.toast-title {
  font-weight: 500;
  margin-bottom: 2px;
}
