/* ────────────────────────────────────────────────────────────
   Dashboard – style.css
   다크 글래스모피즘 대시보드 디자인 시스템
──────────────────────────────────────────────────────────── */

:root {
  --bg: #07091a;
  --surface: rgba(255, 255, 255, 0.04);
  --surface-hov: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.08);
  --border-hov: rgba(255, 255, 255, 0.18);
  --accent: #4f8ef7;
  --accent-2: #7c5ff5;
  --green: #34d399;
  --red: #f87171;
  --text-1: #f0f4ff;
  --text-2: #8b95b8;
  --text-3: #4d5580;
  --radius-sm: 8px;
  --radius: 16px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 60px rgba(0, 0, 0, 0.6);
  --font: 'Inter', system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  height: 100%;
  overflow: hidden;
}

body {
  height: 100vh;
  overflow: hidden;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  background-image:
    radial-gradient(ellipse 80% 60% at 10% 0%, rgba(79, 142, 247, .12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(124, 95, 245, .10) 0%, transparent 60%);
  display: flex;
  flex-direction: column;
}

/* ── 헤더 ────────────────────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 20px;
  height: 44px;
  flex-shrink: 0;
  background: rgba(13, 16, 48, .7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.topbar-right {
  justify-content: flex-end;
}

.logo {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -.5px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.location-pill {
  font-size: .78rem;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 12px;
  border-radius: 20px;
  white-space: nowrap;
}

.clock {
  font-size: 1.7rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-1);
  white-space: nowrap;
}

.date-label {
  font-size: 1rem;
  color: var(--text-2);
  white-space: nowrap;
}

/* 명언 틱커 */
.topbar-center {
  flex: 2;
  text-align: center;
  overflow: hidden;
  position: relative;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quote-text {
  font-size: 1rem;
  font-style: italic;
  color: #cbd5e1;
  white-space: nowrap;
  font-weight: bold;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}

/* ── 메인 영역 (강제 2열) ───────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 12px;
  padding: 12px 20px 0 20px;
  height: calc(100vh - 44px - 140px);
  /* 헤더 44 + 프리푸터 등 140px 여백 확보 */
  max-width: 1366px;
  width: 100%;
  margin: 0 auto;
}

/* 양쪽 컬럼 */
.grid-left,
.grid-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

/* ── 카드 공통 ───────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  overflow: hidden;
  animation: fadeInUp .5s ease both;
}

.card:hover {
  border-color: var(--border-hov);
  box-shadow: var(--shadow-lg);
  transition: border-color .3s, box-shadow .3s;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.card-header h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: .8px;
}

.badge {
  font-size: .65rem;
  color: var(--text-3);
  background: rgba(255, 255, 255, .05);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── 날씨 & 달력 ─────────────────────────────────────────── */
.weather-card {
  flex-shrink: 0;
}

.weather-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow: hidden;
}

.weather-main {
  text-align: center;
  padding: 2px 0;
}

.weather-temp {
  font-size: 2.8rem;
  font-weight: 700;
  line-height: 1;
  background: linear-gradient(135deg, #fff 40%, var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.weather-desc {
  margin-top: 4px;
  font-size: 1.2rem;
  color: var(--text-2);
}

.weather-city {
  margin-top: 2px;
  font-size: 1rem;
  color: var(--text-2);
}

.weather-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.wdetail-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px 8px;
}

.wdetail-icon {
  font-size: 1rem;
}

.wdetail-label {
  display: block;
  font-size: 1rem;
  color: var(--text-3);
  text-transform: uppercase;
}

.wdetail-val {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--text-1);
  margin-top: 1px;
}

.calendar-card {
  flex: 1;
}

.cal-nav {
  display: flex;
  gap: 4px;
}

.cal-nav-btn {
  background: rgba(255, 255, 255, .06);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: 6px;
  padding: 2px 8px;
  font-size: .72rem;
  cursor: pointer;
  transition: .2s;
}

.cal-nav-btn:hover {
  background: var(--surface-hov);
  color: var(--text-1);
}

.cal-today-btn {
  color: var(--accent);
  font-weight: 600;
}

.calendar-body {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  font-size: 1.5rem;
  text-align: center;
  align-content: stretch;
}

.cal-dow {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-3);
  padding: 2px 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-dow.sun {
  color: var(--red);
}

.cal-dow.sat {
  color: var(--accent);
}

.cal-day {
  padding: 0;
  border-radius: 6px;
  color: var(--text-2);
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-day.other-month {
  opacity: .35;
}

.cal-day.today {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(79, 142, 247, .35);
}

.cal-day.sunday {
  color: var(--red);
}

.cal-day.saturday {
  color: var(--accent);
}

.cal-day.today.sunday,
.cal-day.today.saturday {
  color: #fff;
}

/* ── 버스 정보 ─────────────────────────────────────────── */
.bus-card {
  flex-shrink: 0;
}

/* 곧 도착 영역 */
.bus-soon {
  margin-bottom: 6px;
}

/* 정류소별 2x2 그리드 */
.bus-stations-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 6px;
  flex: 1;
  min-height: 0;
}

/* 개별 서브카드 */
.bus-station-subcard {
  background: rgba(255, 255, 255, .03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.bus-station-subcard:hover {
  border-color: var(--border-hov);
}

.bus-station-header {
  font-size: .75rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex-shrink: 0;
}

/* 서브카드 내 스크롤 영역 */
.bus-scroll-list {
  flex: 1;
  overflow-y: hidden;
  position: relative;
  min-height: 0;
}

/* 개별 버스 행 */
.bus-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 2px 4px;
  border-radius: 4px;
  font-size: .8rem;
}

.bus-row:hover {
  background: rgba(255, 255, 255, .04);
}

.bus-row-no {
  font-weight: 700;
  min-width: 45px;
}

.bus-row-time {
  font-weight: 600;
  color: var(--green);
  font-size: .78rem;
  text-align: right;
}

.bus-row-soon {
  color: var(--red) !important;
}

.bus-station-empty {
  font-size: .75rem;
  color: var(--text-3);
  text-align: center;
  padding: 8px 0;
}

.map-card {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.map-wrapper {
  flex: 1;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  min-height: 0;
}

.map-wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: 0;
}

/* ── 하단 프리-푸터 (환율 & 뉴스) ───────────────────────── */
.bottom-widgets {
  display: grid;
  grid-template-columns: 3fr 7fr;
  gap: 12px;
  padding: 10px 20px;
  height: 100px;
  flex-shrink: 0;
  max-width: 1366px;
  width: 100%;
  margin: 0 auto;
}

/* 틱커 공통 (app.js에서 단일 li absolute 주입) */
.rates-list,
.news-list {
  list-style: none;
  flex: 1;
  position: relative;
  overflow: hidden;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, .02);
  border: 1px solid transparent;
  min-height: 40px;
}

.rates-list:hover,
.news-list:hover {
  border-color: var(--border);
}

.rates-item,
.news-item {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  gap: 12px;
}

/* 환율 틱커 항목 내 디자인 */
.rate-currency {
  display: flex;
  align-items: center;
  gap: 8px;
}

.rate-flag {
  font-size: 1.1rem;
}

.rate-code {
  font-weight: 700;
  font-size: 2rem;
}

.rate-values {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rate-val {
  font-weight: 700;
  font-size: 2rem;
}

.rate-change {
  font-size: .7rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 20px;
}

/* 뉴스 틱커 항목 내 디자인 */
.news-item .news-title {
  color: var(--text-1);
  font-size: 1.5rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.news-meta {
  font-size: .7rem;
  color: var(--text-3);
  flex-shrink: 0;
}

.up {
  color: var(--green);
  background: rgba(52, 211, 153, .12);
}

.down {
  color: var(--red);
  background: rgba(248, 113, 113, .12);
}

.flat {
  color: var(--text-3);
}

/* 애니메이션 */
.fx-in {
  animation: slide-in .5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

.fx-out {
  animation: slide-out .5s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slide-out {
  from {
    opacity: 1;
    transform: translateY(0);
  }

  to {
    opacity: 0;
    transform: translateY(-30px);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.rate-skeleton,
.news-skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, rgba(255, 255, 255, .07) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  position: absolute;
  inset: 0;
}

/* ── 푸터 ────────────────────────────────────────────────── */
.footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 0 20px;
  height: 32px;
  flex-shrink: 0;
  z-index: 10;
  font-size: 1rem;
  font-weight: bold;
  /* 또는 700 (굵게 적용) */
  color: var(--text-3);
  border-top: 1px solid var(--border);
  background: rgba(13, 16, 48, .5);
}

.loc-method {
  color: var(--accent);
}

/* 국경일로 판명된 날짜를 빨간색으로 강조 */
.cal-day.holiday {
  color: var(--red) !important;
  /* 저희 대시보드의 예쁜 빨간색 변수를 씁니다 */
  font-weight: bold;
  /* 국경일이니까 좀 더 두껍게 보여줄게요 */
}

/* 툴팁(title) 디자인이 브라우저 기본이라 심심하다면, 여기에 추가 디자인을 할 수도 있어요! */