/* ============================================================
   Professional Field Services — Internal Portal
   professionalfieldservices.co
   style.css  |  Mobile-first, responsive
   ============================================================ */

/* ── 1. Design tokens — matching professionalfieldservices.us ─ */
:root {
  --navy:         #1a2744;
  --navy-dark:    #0f1929;
  --navy-mid:     #243460;
  --red:          #b0232a;
  --red-hover:    #8c1a21;
  --gold:         #c8922a;
  --white:        #ffffff;
  --off-white:    #f7f4ef;
  --surface:      #f0f2f5;
  --text:         #1e1e1e;
  --text-muted:   #555555;
  --border:       #d0ccc4;
  --placeholder:  #c8d8f0;  /* light blue tint for placeholder links */

  --font-sans:    'Source Sans 3', 'Segoe UI', Arial, sans-serif;
  --radius:       6px;
  --radius-lg:    10px;
  --trans:        160ms ease;
  --shadow:       0 2px 8px rgba(0,0,0,.10);
}

/* ── 2. Reset & base ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--surface);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--trans);
}
a:hover { color: var(--red); text-decoration: underline; }
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 2px;
}

/* ── 3. Header ────────────────────────────────────────────── */
.portal-header {
  background: var(--navy-dark);
  border-bottom: 3px solid var(--red);
  padding: 0.75rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,.3);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-logo {
  height: 44px;
  width: auto;
  border-radius: var(--radius);
}

.header-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.header-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -.01em;
}

.header-sub {
  font-size: 0.72rem;
  color: #a0b8d8;
  letter-spacing: .04em;
  text-transform: uppercase;
}

/* Live clock */
.header-clock {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
}

.clock-time {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--white);
  letter-spacing: .03em;
  font-variant-numeric: tabular-nums;
}

.clock-date {
  font-size: 0.75rem;
  color: #a0b8d8;
}

/* ── 4. Main layout ───────────────────────────────────────── */
.portal-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
}

.portal-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ── 5. Top row (search + weather) ────────────────────────── */
.top-row {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1.25rem;
  align-items: start;
}

/* ── 6. Widget base ───────────────────────────────────────── */
.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  box-shadow: var(--shadow);
}

.widget-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── 7. Search widget ─────────────────────────────────────── */
.search-engines {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.65rem;
}

.engine-btn {
  padding: 0.3rem 0.85rem;
  background: var(--off-white);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2rem;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--trans), color var(--trans), border-color var(--trans);
}

.engine-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.engine-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.search-input-row {
  display: flex;
  gap: 0.5rem;
}

.search-input-row input[type="text"] {
  flex: 1;
  padding: 0.6rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--trans);
}

.search-input-row input[type="text"]:focus {
  border-color: var(--navy);
}

.search-btn {
  padding: 0.6rem 1.25rem;
  background: var(--red);
  color: var(--white);
  border: none;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--trans);
  white-space: nowrap;
}

.search-btn:hover { background: var(--red-hover); }

/* ── 8. Weather widget ────────────────────────────────────── */
.weather-widget { height: 100%; }

.weather-loading, .weather-error {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.weather-main {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1;
}

.weather-desc {
  font-size: 1rem;
  color: var(--text-muted);
}

.weather-details {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.weather-location {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

/* ── 9. Links section ─────────────────────────────────────── */
.links-section { width: 100%; }

.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.1rem;
}

.link-group {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: 3px solid var(--navy);
  border-radius: var(--radius-lg);
  padding: 1rem 1.1rem 1.1rem;
  box-shadow: var(--shadow);
}

.group-title {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--navy);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
}

.group-icon { font-size: 0.9rem; }

.link-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.link-list li a {
  display: block;
  padding: 0.4rem 0.5rem;
  border-radius: var(--radius);
  font-size: 0.93rem;
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  transition: background var(--trans), color var(--trans);
}

.link-list li a:hover {
  background: var(--off-white);
  color: var(--red);
  text-decoration: none;
}

/* Placeholder links — visually distinct so you know to fill them in */
.link-list li.placeholder a {
  color: var(--text-muted);
  font-weight: 400;
  font-style: italic;
  opacity: 0.65;
}

.link-list li.placeholder a:hover {
  background: #f0f4ff;
  color: var(--navy-mid);
  opacity: 1;
}

/* ── 10. Notes section ────────────────────────────────────── */
.notes-section { width: 100%; }

.notes-widget {
  padding: 1rem 1.25rem 1.1rem;
}

.notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.notes-header .widget-title { margin-bottom: 0; }

.notes-controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.notes-status {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
  min-width: 48px;
}

.notes-btn {
  padding: 0.3rem 0.75rem;
  background: var(--off-white);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--trans), color var(--trans);
}

.notes-btn:hover {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.notes-btn-danger:hover {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.notes-area {
  width: 100%;
  min-height: 140px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  resize: vertical;
  line-height: 1.6;
  outline: none;
  transition: border-color var(--trans);
}

.notes-area:focus { border-color: var(--navy); }

.notes-hint {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-align: right;
  font-style: italic;
}

/* ── 11. Footer ───────────────────────────────────────────── */
.portal-footer {
  background: var(--navy-dark);
  border-top: 3px solid var(--red);
  padding: 1rem 1.25rem;
  text-align: center;
  font-size: 0.78rem;
  color: #607090;
}

.portal-footer a {
  color: #8aa0c8;
  text-decoration: none;
}
.portal-footer a:hover { color: var(--white); }

.footer-note {
  margin-top: 0.2rem;
  font-size: 0.7rem;
  color: #3a4a60;
}

/* ── 12. Responsive breakpoints ───────────────────────────── */

/* Tablet — collapse weather below search */
@media (max-width: 860px) {
  .top-row {
    grid-template-columns: 1fr;
  }
  .weather-widget {
    /* On tablet show weather inline rather than in a tall box */
  }
  .weather-main { margin-bottom: 0.25rem; }
}

/* Mobile */
@media (max-width: 560px) {
  .header-inner { justify-content: center; }
  .header-clock { align-items: center; }
  .clock-time   { font-size: 1.1rem; }
  .links-grid   { grid-template-columns: 1fr 1fr; }
  .search-engines { gap: 0.3rem; }
  .engine-btn   { font-size: 0.72rem; padding: 0.25rem 0.65rem; }
}

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

/* ── 13. Print ────────────────────────────────────────────── */
@media print {
  .portal-header, .portal-footer,
  .search-widget, .weather-widget,
  .notes-section { display: none; }
  body { background: #fff; }
  .link-group { border: 1px solid #ccc; break-inside: avoid; }
}
