/* ===========================
   Base Reset
=========================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg1: #0b1424;
  --bg2: #162846;
  --bg3: #2a4b7c;
  --bg4: #3b5fa6;
  --panelTop: #2f5ca8;
  --panelBot: #0f2d5b;
  --line: rgba(255, 255, 255, 0.20);
  --text: #f4f7fb;
  --muted: #eaf2ff;
  --accent: #7fb2ff;
  --btn1: #003366;
  --btn2: #0055aa;
}

/* ===========================
   Browser Rendering Optimizations
=========================== */
html, body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "liga", "kern";
}

/* ===========================
   Layout
=========================== */
body {
  min-height: 100vh;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: radial-gradient(
    circle at 50% 50%,
    #4c7edc 0%,
    var(--bg4) 20%, 
    var(--bg3) 45%, 
    var(--bg2) 75%, 
    var(--bg1) 100%
  ) fixed;
  display: flex;
  flex-direction: column;
}

.grid {
  width: 100%;
  max-width: 1300px;
  margin: 18px auto;
  padding: 0 16px 28px;
  display: grid;
  grid-template-columns: 1fr minmax(340px, 560px) 1fr;
  gap: 18px;
}

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

/* ===========================
   Header
=========================== */
header.flag {
  width: 100%;
  text-align: center;
  color: #fff;
  padding: clamp(40px, 8vw, 72px) 20px;
  border-bottom: 1px solid rgba(255, 255, 255, .18);
  background-color: #0b1424;
  background-image: url("https://navytime.net/assets/us_flag.jpg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

header.flag h1 {
  font-style: italic;
  font-weight: 1000;
  letter-spacing: .06em;
  font-size: clamp(56px, 8vw, 120px);
  text-shadow: 0 3px 8px rgba(0, 0, 0, .7);
  color: #ffffff;
}

header.flag p {
  margin-top: 16px;
  font-style: italic;
  color: var(--accent);
  font-size: clamp(20px, 3.5vw, 32px);
  font-weight: 700;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .6);
}

/* ===========================
   Panels
=========================== */
.panel {
  background: linear-gradient(180deg, var(--panelTop), var(--panelBot));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 12px 8px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.panel:hover {
  background: linear-gradient(180deg, #264c8f, #0c2347);
  box-shadow: 0 14px 44px rgba(0, 0, 0, 0.35);
}

.panel-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin-bottom: 8px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.18);
  padding-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.panel-title select,
.panel-title input[type="text"] {
  background: #0f1c32;
  color: #eaf2ff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  font-size: .95rem;
}

.panel-title button {
  background: linear-gradient(135deg, var(--btn1), var(--btn2));
  color: #fff;
  border: 1px solid rgba(255, 255, 255, .25);
  border-radius: 8px;
  padding: 5px 10px;
  font-weight: 800;
  cursor: pointer;
}

.panel-title button:hover {
  filter: brightness(1.08);
}

/* ===========================
   Clock Panel
=========================== */
.panel.clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100%;
  padding: 16px;
}

.time-display {
  font-size: clamp(64px, 10vw, 140px);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.04em;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--text);
  text-shadow: 0 3px 8px rgba(0,0,0,0.6);
}

.date-display {
  margin-top: 12px;
  font-size: clamp(20px, 2.5vw, 30px);
  font-weight: 600;
  color: var(--muted);
}

/* ===========================
   Forum Link Button
=========================== */
.forum-link {
  margin-top: 16px;
  text-align: center;
}

.forum-link a {
  display: inline-block;
  padding: 12px 24px;
  font-size: 1.05rem;
  font-weight: 800;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--btn1), var(--btn2));
  color: #fff;
  text-decoration: none;
  border-radius: 10px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
  transition: background .25s ease, transform .2s ease;
}

.forum-link a:hover {
  background: linear-gradient(135deg, #0055aa, #0077dd);
  transform: translateY(-2px);
}

/* ===========================
   Upcoming Holidays
=========================== */
.holiday-list {
  margin-top: auto;
  text-align: center;
}

.holiday-list h3 {
  display: none;
}

.holiday-list ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.holiday-list li {
  font-size: 1.05rem;
  font-weight: 700;
  display: inline-block;
  margin: 0 6px;
  color: var(--text);
}

/* ===========================
   Weather
=========================== */
#weather {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  height: 100%;
  overflow: hidden;
}

.weather-now {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  margin-bottom: 6px;
}

.weather-temp {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

.weather-desc {
  font-size: 0.9rem;
  opacity: .9;
  line-height: 1.2;
}

.weather-forecast {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 4px;
  margin-bottom: auto;
}

.weather-forecast li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  opacity: .95;
}

.weather-forecast li img {
  width: 22px;
  height: 22px;
  margin-left: 6px;
}

#w-updated,
#w-where,
#w-alerts,
.accuweather-credit {
  text-align: center;
  font-size: 0.8rem;
  opacity: .8;
  margin-top: 4px;
  flex-shrink: 0;
}

#w-alerts {
  color: #ffb3b3;
  font-weight: bold;
}

.accuweather-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 0.8rem;
  margin-top: auto;
}

.accuweather-credit img.accuweather-logo {
  height: 16px;
  width: auto;
}

/* ===========================
   Lists / Links
=========================== */
.list {
  list-style: none;
}

.list li {
  margin: 8px 0;
  line-height: 1.35;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.list a {
  color: #fff;
  text-decoration: none;
}

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

.feed-thumb {
  max-width: 120px;
  max-height: 90px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}

/* ===========================
   Scrollbox
=========================== */
.scrollbox {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

#navy-scroll,
#nasa-scroll,
#news-scroll {
  flex: 1;
  max-height: none;
  overflow-y: auto;
}

/* ===========================
   Footer
=========================== */
footer {
  margin: 8px 0 16px;
  font-size: .9rem;
  color: #ccc;
  text-align: center;
}

/* ===========================
   Panel Alignment Fix
=========================== */
.grid > aside,
.grid > section {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.grid > aside .panel,
.grid > section .panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 420px;
  max-height: 420px;
}

/* ===========================
   Header Override
=========================== */
header.flag h1 {
  font-size: clamp(56px, 8vw, 120px) !important;
  text-shadow: 0 3px 8px rgba(0, 0, 0, .7) !important;
  color: #ffffff !important;
}

html {
  height: 100%;
  background: radial-gradient(
    circle at 50% 50%,
    #4c7edc 0%,
    var(--bg4) 20%, 
    var(--bg3) 45%, 
    var(--bg2) 75%, 
    var(--bg1) 100%
  ) no-repeat center center fixed;
  background-size: cover;
}

body {
  min-height: 100%;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  display: flex;
  flex-direction: column;
  background: transparent;
}

/* ===========================
   Background Fix for Mobile
=========================== */
html, body {
  height: 100%;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  background: radial-gradient(
    circle at 50% 50%,
    #4c7edc 0%,
    var(--bg4) 20%,
    var(--bg3) 45%,
    var(--bg2) 75%,
    var(--bg1) 100%
  ) no-repeat center center fixed;
  background-size: cover;
}

/* ---------- Clock Fix ---------- */
.panel.clock {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  height: 100%;
}

.time-display {
  font-size: clamp(80px, 7vw, 90px);
  font-weight: 950;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.1;
}

.date-display {
  margin-top: 12px;
  font-size: clamp(20px, 2vw, 28px);
  color: var(--muted);
  font-weight: 600;
}

#trending-scroll {
  flex: 1;
  overflow-y: auto;
  background: #001f3f;
  color: #fff;
  padding: 10px;
  border-radius: 6px;
}

.numbered-trending .num {
  color: #7ec8ff;
  font-weight: bold;
  margin-right: 6px;
}

.numbered-trending a {
  color: #7ec8ff;
  text-decoration: none;
}

.numbered-trending a:hover {
  text-decoration: underline;
}

.numbered-trending .source {
  display: block;
  font-size: 0.8em;
  color: #ccc;
  margin-left: 22px;
}

/* --- Top 10 Trending News Panel --- */
/* Use identical layout & scrolling as every other feed panel */
#trending-scroll {
  /* inherit flex:1 and overflow-y:auto from .scrollbox */
  background: linear-gradient(180deg, var(--panelTop), var(--panelBot));
  color: var(--text);
  padding: 8px 10px;
  border-radius: 10px;
}

/* match list styling to other feeds */
.numbered-trending {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.numbered-trending li {
  margin: 8px 0;
  line-height: 1.35;
}

.numbered-trending .num {
  color: var(--accent);
  font-weight: 700;
  margin-right: 6px;
}

.numbered-trending a {
  color: var(--accent);
  text-decoration: none;
}

.numbered-trending a:hover {
  text-decoration: underline;
}

.numbered-trending .source {
  display: block;
  font-size: 0.8em;
  color: var(--muted);
  margin-left: 22px;
}

/* === Top 10 Trending News Panel === */
#trending-scroll {
  flex: 1;
  overflow-y: auto;     /* identical scroll behaviour */
}

#trending .num {
  color: var(--accent);
  font-weight: bold;
  margin-right: 6px;
}

#trending .source {
  display: block;
  font-size: 0.8em;
  color: var(--muted);
  margin-left: 22px;
}

.main-nav {
  text-align: center;
  background: rgba(10, 25, 55, 0.8);
  padding: 10px 0;
  margin-bottom: 20px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
}

.main-nav a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
  margin: 0 16px;
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

.time-extra {
  margin-top: 12px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.zulu-time,
.local-time {
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* === Clock Panel Heading Style === */
.holiday-heading {
  text-decoration: underline;
  text-underline-offset: 4px;
  font-weight: 800;
  margin-top: 14px;
  display: inline-block;
}

.holiday-heading::after {
  content: ":";
  margin-left: 3px;
  
  .center-stack {
  display: flex;
  flex-direction: column;
  gap: 1.5rem; /* adds space between panels */
}

.panel.clock,
.panel.stack-gap {
  position: static;
  width: 100%;
}

/* ===========================
   Weather Panel (AccuWeather Integration)
=========================== */

/* Weather panel layout & typography */
#weather-panel,
#weather {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  text-align: center;
  color: var(--text);
}

/* Current conditions */
#current-weather {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 8px;
}

#current-weather img#weather-icon {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4));
}

/* Temperature & description text */
#temperature {
  font-size: 1.6rem;
  font-weight: 900;
  line-height: 1;
}

#description {
  display: block;
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Forecast row */
#forecast {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.forecast-day {
  width: 60px;
  font-size: 0.8rem;
  text-align: center;
}

.forecast-day img {
  width: 40px;
  height: 40px;
}

/* AccuWeather attribution */
.weather-attribution,
.accuweather-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.8rem;
  opacity: 0.85;
  margin-top: auto;
  color: var(--muted);
}

.accuweather-credit img.accuweather-logo {
  height: 18px;
  width: auto;
}

/* Optional dark-mode tune for SVG logo */
@media (prefers-color-scheme: dark) {
  .accuweather-credit img.accuweather-logo {
    filter: brightness(1.2);
  }
}













   
    

