﻿/* ==========================================================================
   LGRx Soil Moisture Network — Custom Design System
   University of Michigan
   ========================================================================== */

:root {
  --umich-blue: #00274C;
  --umich-blue-dark: #001b36;
  --umich-blue-matte: #00274C;
  --umich-maize: #FFCB05;
  --accent-cyan: #00b4d8;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  
  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
}

/* Base Styles - Arial font */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Header & Navigation Taskbar — Scrolls away with the page (position: relative) */
.header {
  background-color: var(--umich-blue-matte);
  color: #ffffff;
  padding: 0.6rem 1.5rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  z-index: 100;
}

.header-container {
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

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

.branding img {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
}

.branding-text h1 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.3rem;
  font-weight: bold;
  color: #ffffff;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  line-height: 1.2;
}

.branding-text h1 .badge-lgrx {
  background-color: var(--umich-maize);
  color: var(--umich-blue-dark);
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border-radius: 16px;
  font-weight: bold;
  text-transform: uppercase;
}

.branding-text p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a, .nav-links button {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #ffffff;
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  font-family: Arial, Helvetica, sans-serif;
}

.nav-links a:hover, .nav-links button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--umich-maize);
  color: var(--umich-maize);
}

.nav-links .btn-highlight {
  background: var(--umich-maize);
  color: var(--umich-blue-dark);
  font-weight: bold;
  border-color: var(--umich-maize);
}

.nav-links .btn-highlight:hover {
  background: #e6b800;
  color: var(--umich-blue-dark);
}

/* Page Layout */
.main-wrapper {
  max-width: 1800px;
  margin: 0 auto;
  padding: 1.25rem;
}

.pulse-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--accent-green);
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: pulse 2s infinite;
  margin-right: 6px;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
  100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* Sections Styling */
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.65rem;
  margin-bottom: 1rem;
}

.section-header h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--umich-blue);
}

/* Data Download Form */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  align-items: end;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--text-main);
  font-family: Arial, Helvetica, sans-serif;
}

.form-group select, .form-group input {
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  background-color: #fff;
  color: var(--text-main);
  transition: border-color 0.2s ease;
  font-family: Arial, Helvetica, sans-serif;
}

.form-group select:focus, .form-group input:focus {
  outline: none;
  border-color: var(--umich-blue);
  box-shadow: 0 0 0 3px rgba(0, 39, 76, 0.1);
}

.preset-buttons {
  display: flex;
  gap: 0.4rem;
}

.btn-preset {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s ease;
  font-family: Arial, Helvetica, sans-serif;
}

.btn-preset:hover {
  background: var(--umich-blue);
  color: #fff;
  border-color: var(--umich-blue);
}

/* Solid Matte Blue Submit Button */
.btn-submit {
  background-color: var(--umich-blue-matte);
  color: #ffffff;
  font-weight: bold;
  font-size: 0.9rem;
  padding: 0.6rem 1.25rem;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  font-family: Arial, Helvetica, sans-serif;
}

.btn-submit:hover {
  background-color: var(--umich-blue-dark);
  box-shadow: var(--shadow-sm);
}

.download-note {
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  background: #f1f5f9;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
}

.download-status {
  margin-top: 0.75rem;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: bold;
  display: none;
}

.download-status.info {
  display: block;
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.download-status.success {
  display: block;
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.download-status.error {
  display: block;
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Network Overview Plots - Centered Alignment */
.plot-row {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  width: 100%;
}

.plot-row iframe {
  width: 450px;
  max-width: 100%;
  height: 280px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color) !important;
  background: #ffffff;
  margin: 0 auto;
  display: block;
}

/* ALL 4 NODES ON 1 PAGE GRID */
.all-nodes-container {
  margin-bottom: 1.25rem;
}

.nodes-grid-4col {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.25rem;
}

@media (max-width: 1600px) {
  .nodes-grid-4col {
    grid-template-columns: repeat(2, 1fr);
  }
}

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

.node-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  align-items: center;
}

.node-card:hover {
  border-color: var(--umich-blue);
  box-shadow: var(--shadow-md);
}

.node-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--umich-blue);
  width: 100%;
}

.node-header h3 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--umich-blue);
}

.node-header h3 a {
  color: var(--umich-blue);
  text-decoration: none;
}

.node-header h3 a:hover {
  color: var(--accent-cyan);
  text-decoration: underline;
}

.node-status-badge {
  background-color: #dcfce7;
  color: #166534;
  font-size: 0.75rem;
  font-weight: bold;
  padding: 0.2rem 0.6rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

/* IFRAME CONTAINER - CENTERED ALIGNMENT FOR ALL VISUALIZATIONS */
.iframe-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
}

.iframe-container iframe {
  width: 100%;
  max-width: 450px;
  height: 260px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: #ffffff;
  margin: 0 auto;
  display: block;
}

/* Top Battery Gauge Widget — Height set to 245px */
.widget-iframe {
  height: 245px !important;
  max-width: 450px;
  margin: 0 auto;
  display: block;
}

/* Soil Moisture Operating Manual Section — Solid Matte Blue */
.manual-banner {
  background-color: var(--umich-blue-matte);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.25rem;
}

.manual-content h2 {
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.3rem;
  font-weight: bold;
  color: var(--umich-maize);
}

.manual-actions {
  display: flex;
  gap: 0.75rem;
}

.btn-manual-primary {
  background-color: var(--umich-maize);
  color: var(--umich-blue-dark);
  font-weight: bold;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
  font-family: Arial, Helvetica, sans-serif;
}

.btn-manual-primary:hover {
  background-color: #e6b800;
  transform: translateY(-1px);
}

.btn-manual-secondary {
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  font-weight: bold;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all 0.2s ease;
  font-family: Arial, Helvetica, sans-serif;
}

.btn-manual-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: #ffffff;
}

/* Footer — Solid Matte Blue */
.footer {
  background-color: var(--umich-blue-dark);
  color: #94a3b8;
  padding: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  border-top: 3px solid var(--umich-maize);
  font-family: Arial, Helvetica, sans-serif;
}

.footer a {
  color: var(--umich-maize);
  text-decoration: none;
}

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