/* --- DARK NAVY THEME --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Tahoma, sans-serif;
  background: linear-gradient(135deg, #0b1f3f 0%, #162b54 100%);
  color: #f5f5f5;
  padding: 20px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
}
h1 { text-align: center; margin-bottom: 20px; color: #ffd700; letter-spacing: 1px; font-size: 28px; }
h2 { font-size: 18px; color: #ffffff; margin-bottom: 10px; }
.subtext { font-size: 14px; color: #d0d0d0; margin-bottom: 15px; }

/* --- MAIN LAYOUT (DEFAULT: 16:9) --- */
.dashboard {
  display: flex;
  flex-direction: row;
  justify-content: center;
  gap: 20px;
  width: 100%;
  max-width: 1600px;
  height: calc(100vh - 80px);
}
.column { display: flex; flex-direction: column; gap: 20px; }

/* --- CALENDAR COLUMN (LEFT) --- */
.column-left {
  width: 30%;
  max-width: 400px;
}
#calendarWidget h2, #calendarWidget .subtext {
  text-align: center;
}
#calendarWidget .calendar {
  background: rgba(22,43,84,0.75);
  border-radius: 8px;
  padding: 15px;
  margin-bottom: 10px;
}
.header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.header button { background: none; border: none; color: #ffd700; font-size: 24px; cursor: pointer; }
.month-year { font-size: 18px; font-weight: bold; color: #ffffff; text-transform: capitalize; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.day-name { font-size: 12px; font-weight: bold; text-align: center; color: #ffffff; }
.date {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.05);
  color: #f5f5f5;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}
.date:hover { background: rgba(255,255,255,0.15); }
.date.today { border: 2px solid #ffd700; }
.date.meeting {
  background: #ffd700;
  color: #0b1f3f;
  box-shadow: 0 0 8px rgba(255,215,0,0.6);
}
.legend { display: flex; align-items: center; justify-content: center; margin-top: 10px; font-size: 13px; color: #ffffff; }
.legend-box { width: 14px; height: 14px; background: #ffd700; border-radius: 3px; margin-right: 6px; }

/* --- RATE & WIBOR COLUMN (CENTER) --- */
.column-center {
  width: 35%;
  max-width: 500px;
  align-items: center;
}
.stat-widget h2 { text-align: center; }
.rate-value, .wibor-value {
  background: rgba(22,43,84,0.75);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}
.value-unit { font-size: 24px; color: #ffd700; margin-bottom: 5px; }
.value-num { font-size: 56px; font-weight: bold; color: #ffffff; }

/* --- DIFFERENCE STYLES --- */
.difference-text {
  font-size: 12px;
  color: #d0d0d0;
  margin-top: 8px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.difference-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: bold;
  background: linear-gradient(135deg, #2e4a7d, #1a365d);
  border: 1px solid #4a6fa5;
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
}

.difference-arrow.up {
  color: #ffffff;
}

.difference-arrow.down {
  color: #ffd700;
}

.difference-value {
  font-weight: 600;
  color: #ffffff;
}

.difference-label {
  color: #d0d0d0;
  font-size: 11px;
}

/* --- FRA & NEWS COLUMN (RIGHT) --- */
.column-right {
  width: 35%;
  max-width: 400px;
}
#fraWidget { position: relative; }
#fraWidget h2 { text-align: center; margin-bottom: 15px; }
.fra-list {
  display: flex;
  flex-direction: row;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scroll-behavior: smooth;
  padding: 20px 60px;
}
.fra-list::-webkit-scrollbar { display: none; }
.fra-item {
  scroll-snap-align: center;
  flex: 0 0 200px;
  aspect-ratio: 1;
  background: rgba(11,31,63,0.75);
  border: 1px solid #2e4a7d;
  border-radius: 10px;
  margin: 0 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
}
.fra-item .label { font-size: 16px; color: #ffffff; margin-bottom: 10px; text-align: center; }
.fra-item .percent { font-size: 24px; color: #ffd700; margin-bottom: 5px; }
.fra-item .value { font-size: 36px; font-weight: bold; color: #ffffff; margin-bottom: 5px; }
.fra-item .difference { 
  font-size: 11px; 
  color: #d0d0d0; 
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 5px;
}

.fra-prev, .fra-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(22,43,84,0.85);
  color: #ffd700;
  border: none;
  font-size: 28px;
  cursor: pointer;
  padding: 10px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,0.7);
  z-index: 2;
}
.fra-prev { left: 10px; }
.fra-next { right: 10px; }
.fra-list::before, .fra-list::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: 60px;
  pointer-events: none;
  z-index: 1;
}
.fra-list::before {
  left: 0;
  background: linear-gradient(to right, #0b1f3f, rgba(11,31,63,0));
}
.fra-list::after {
  right: 0;
  background: linear-gradient(to left, #0b1f3f, rgba(11,31,63,0));
}

/* --- NEWS WIDGET STYLES --- */
#newsWidget h2 { text-align: center; }
.news-list { display: flex; flex-direction: column; gap: 10px; }
.news-item { background: rgba(22,43,84,0.75); padding: 10px; border-radius: 5px; transition: background 0.2s; }
.news-item:hover { background: rgba(255,255,255,0.1); }
.news-item a { color: #ffd700; text-decoration: none; font-size: 14px; }
.news-item a:hover { text-decoration: underline; }
.news-error { font-size: 12px; color: #ff6b6b; text-align: center; }

/* --- WIDGET STYLES --- */
.widget {
  background: rgba(11,31,63,0.85);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.7);
  height: fit-content;
}

/* --- FOOTER STYLES --- */
footer {
  margin-top: 20px;
  text-align: center;
  font-size: 12px;
  color: #d0d0d0;
  width: 100%;
  max-width: 1600px;
}
footer a {
  color: #ffd700;
  text-decoration: none;
  margin: 0 5px;
}
footer a:hover {
  text-decoration: underline;
}

/* --- MOBILE VIEW (STACKED LAYOUT & HORIZONTAL FRA CAROUSEL) --- */
@media (max-width: 768px) {
  .dashboard {
    flex-direction: column;
    height: auto;
    gap: 15px;
  }
  .column-left, .column-center, .column-right {
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
  }
  h1 { font-size: 24px; }
  h2 { font-size: 16px; }
  .subtext { font-size: 12px; }
  .column-center { align-items: stretch; }
  .rate-value, .wibor-value {
    padding: 15px;
  }
  .value-unit { font-size: 20px; }
  .value-num { font-size: 48px; }
  .difference-text { 
    font-size: 11px; 
    gap: 4px;
  }
  .difference-arrow {
    width: 16px;
    height: 16px;
    font-size: 10px;
  }
  .difference-label {
    font-size: 10px;
  }
  .widget { padding: 15px; }
  .calendar { padding: 10px; }
  .day-name { font-size: 10px; }
  .date { font-size: 12px; }
  .header button { font-size: 20px; }
  .month-year { font-size: 16px; }
  .legend { font-size: 12px; }
  .legend-box { width: 12px; height: 12px; }
  .fra-item {
    flex: 0 0 200px;
    margin: 0 10px;
  }
  .fra-item .label { font-size: 14px; }
  .fra-item .percent { font-size: 20px; }
  .fra-item .value { font-size: 32px; }
  .fra-item .difference { 
    font-size: 10px; 
    gap: 3px;
  }
  .news-item a { font-size: 12px; }
  .news-error { font-size: 11px; }
  footer { font-size: 11px; }
}
