/* ============================================================
   Belvedere Heights Digital Notice Board
   Designed for 75" 4K TV (3840 x 2160)
   ============================================================ */

/* Reset & Base */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100vw;
  height: 100vh;
  overflow: hidden;
  font-family: 'Segoe UI', 'Microsoft YaHei', 'Microsoft JhengHei', sans-serif;
  background: #0a0a0a;
  color: #e0e0e0;
}

/* ============================================================
   TOP BANNER
   ============================================================ */
.top-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 14px 0;
  background: linear-gradient(180deg, #1a1a3e 0%, #16213e 100%);
  border-bottom: 2px solid #e94560;
  flex-shrink: 0;
}

.banner-text {
  font-size: 1.6rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1px;
  white-space: nowrap;
}

.banner-divider {
  font-size: 1.6rem;
  color: #e94560;
  font-weight: 300;
}

/* ============================================================
   NOTICE BOARD GRID LAYOUT
   5 columns x 2 rows for 4K (3840 x 2160)
   YouTube: Col 1+2 Row 2, landscape (2 cols wide)
   Events:  Col 2 Row 1
   Financials: Col 3, stacked vertically
   Minutes: Cols 4-5, 2x2 grid
   ============================================================ */
body {
  display: flex;
  flex-direction: column;
}

.notice-board {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  grid-template-areas:
    "weather  events   fin1     min1     min3"
    "news     news     fin2     min2     min4";
  flex: 1;
  gap: 4px;
  padding: 4px;
  background: #111;
}

/* Grid area assignments */
.weather-panel   { grid-area: weather; }
.events-panel    { grid-area: events; }
#financials-p1-panel { grid-area: fin1; }
#financials-p2-panel { grid-area: fin2; }
#minutes-p1-panel    { grid-area: min1; }
#minutes-p2-panel    { grid-area: min2; }
#minutes-p3-panel    { grid-area: min3; }
#minutes-p4-panel    { grid-area: min4; }
.news-panel     { grid-area: news; }

/* ============================================================
   GRID CELL COMMON STYLES
   ============================================================ */
.grid-cell {
  background: #1a1a2e;
  border: 1px solid #2a2a4a;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Panel Header */
.panel-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  background: linear-gradient(180deg, #16213e 0%, #1a1a2e 100%);
  border-bottom: 2px solid #e94560;
  flex-shrink: 0;
}

.header-icon {
  font-size: 1.4rem;
}

.header-title {
  font-size: 1.2rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.5px;
}

/* ============================================================
   WEATHER PANEL
   ============================================================ */
.weather-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 16px;
  gap: 12px;
  overflow: hidden;
}

.weather-main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 10px 0;
}

.weather-temp {
  font-size: 3.5rem;
  font-weight: 700;
  color: #ffffff;
  line-height: 1;
}

.weather-icon {
  font-size: 3rem;
}

.weather-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 1rem;
}

.weather-row {
  display: flex;
  justify-content: space-between;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 4px;
}

.weather-row span:first-child {
  color: #888;
}

.weather-row span:last-child {
  color: #e0e0e0;
  font-weight: 500;
}

/* Weather Warnings */
.weather-warnings {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.warning-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  animation: warning-pulse 2s infinite;
}

.warning-badge.rain-red {
  background: #cc0000;
  color: #fff;
}

.warning-badge.rain-black {
  background: #000;
  color: #ff0;
  border: 2px solid #ff0;
}

.warning-badge.typhoon-t1 {
  background: #0066cc;
  color: #fff;
}

.warning-badge.typhoon-t3 {
  background: #ff6600;
  color: #fff;
}

.warning-badge.typhoon-t8,
.warning-badge.typhoon-t9,
.warning-badge.typhoon-t10 {
  background: #cc0000;
  color: #fff;
  animation: warning-pulse 0.5s infinite;
}

.warning-badge.default {
  background: #ff8800;
  color: #fff;
}

@keyframes warning-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

/* ============================================================
   PDF PANELS (Events, Financials, Minutes)
   ============================================================ */
.pdf-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
  overflow: hidden;
  position: relative;
}

.pdf-container canvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.pdf-placeholder {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #555;
  font-size: 1.2rem;
}

.pdf-page-indicator {
  padding: 6px 12px;
  text-align: center;
  font-size: 0.85rem;
  color: #888;
  background: rgba(0,0,0,0.3);
  flex-shrink: 0;
}

/* ============================================================
   GOVHK NEWS PANEL
   ============================================================ */
.news-panel .panel-header {
  border-bottom-color: #2196F3;
}

.news-content {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
  padding: 8px 0;
}

.news-placeholder {
  color: #555;
  text-align: center;
  width: 100%;
  font-size: 1.5rem;
}

.news-ticker-row {
  overflow: hidden;
  white-space: nowrap;
  padding: 12px 0;
}

.news-ticker {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  animation: scroll-news 80s linear infinite;
  gap: 80px;
  padding: 0 20px;
}

.news-ticker:hover {
  animation-play-state: paused;
}

@keyframes scroll-news {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.news-item {
  color: #e0e0e0;
  font-size: 3rem;
  line-height: 1.3;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.news-item-img {
  position: relative;
}

.news-img {
  height: 140px;
  width: auto;
  max-width: 250px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
}

.news-title-text {
  position: relative;
  z-index: 1;
}

.news-bullet {
  color: #2196F3;
  font-size: 2.8rem;
  flex-shrink: 0;
}

.news-bullet.tc-bullet {
  color: #FF9800;
}

.news-time {
  color: #888;
  font-size: 2.2rem;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

.news-timestamp {
  color: #555;
  font-size: 2rem;
  flex-shrink: 0;
  margin-left: 16px;

/* ============================================================
   REFRESH INDICATOR
   ============================================================ */
.refresh-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #0f0;
  display: inline-block;
  margin-left: auto;
  animation: refresh-blink 3s infinite;
}

@keyframes refresh-blink {
  0%, 80%, 100% { opacity: 1; }
  85%, 95% { opacity: 0.3; }
}

/* ============================================================
   RESPONSIVE FONT SCALING
   For 4K (3840x2160), the browser uses default scaling.
   All sizes above are tuned for this resolution.
   ============================================================ */

/* Error / no-data state */
.no-data {
  color: #666;
  text-align: center;
  padding: 20px;
  font-size: 1.1rem;
}

/* Smooth transitions for PDF page changes */
.pdf-container canvas {
  transition: opacity 0.5s ease;
}

/* ============================================================
   RESPONSIVE: Mobile / Tablet (max-width: 900px)
   Single column layout, scrollable, touch-friendly
   ============================================================ */
@media (max-width: 900px) {
  html, body {
    overflow: auto;
    height: auto;
  }

  body {
    display: block;
  }

  /* Banner: stacked + smaller */
  .top-banner {
    flex-direction: column;
    gap: 4px;
    padding: 10px 8px;
    text-align: center;
  }

  .banner-text {
    font-size: 0.95rem;
    white-space: normal;
  }

  .banner-divider {
    display: none;
  }

  /* Grid: single column, auto height */
  .notice-board {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 6px;
    height: auto;
  }

  /* Override grid-area assignments */
  .weather-panel,
  .events-panel,
  #financials-p1-panel,
  #financials-p2-panel,
  #minutes-p1-panel,
  #minutes-p2-panel,
  #minutes-p3-panel,
  #minutes-p4-panel,
  .news-panel {
    grid-area: auto;
    min-height: 280px;
    flex-shrink: 0;
  }

  /* News panel: shorter on mobile */
  .news-panel {
    min-height: 200px;
    max-height: 400px;
  }

  /* YouTube: removed — replaced by news panel */

  /* Smaller panel headers */
  .panel-header {
    padding: 6px 10px;
    gap: 6px;
  }

  .header-icon {
    font-size: 1rem;
  }

  .header-title {
    font-size: 0.85rem;
  }

  /* Weather: smaller temp */
  .weather-content {
    padding: 10px;
    gap: 8px;
  }

  .weather-temp {
    font-size: 2rem;
  }

  .weather-icon {
    font-size: 1.8rem;
  }

  .weather-details {
    font-size: 0.8rem;
    gap: 4px;
  }

  .weather-row {
    padding: 3px 6px;
  }

  .warning-badge {
    font-size: 0.75rem;
    padding: 6px 8px;
  }

  /* PDF: smaller indicator */
  .pdf-page-indicator {
    font-size: 0.7rem;
    padding: 4px 8px;
  }

  .pdf-placeholder {
    font-size: 0.85rem;
  }

  .no-data {
    font-size: 0.85rem;
    padding: 12px;
  }
}

/* Very small screens (max-width: 480px) */
@media (max-width: 480px) {
  .banner-text {
    font-size: 0.8rem;
  }

  .weather-temp {
    font-size: 1.6rem;
  }

  .header-title {
    font-size: 0.75rem;
  }

  .weather-panel,
  .events-panel,
  #financials-p1-panel,
  #financials-p2-panel,
  #minutes-p1-panel,
  #minutes-p2-panel,
  #minutes-p3-panel,
  #minutes-p4-panel {
    min-height: 220px;
  }
}
