/* ============================================
   Private Dashboard — Modern Gothic Style
   Colors: Black & White only
   Corners: Sharp (no border-radius)
   ============================================ */

@import url("https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700;900&family=Inter:wght@300;400;500;600;700&display=swap");

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-radius: 0 !important;
}

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --text-primary: #000000;
  --text-secondary: #333333;
  --text-muted: #777777;
  --border-color: #d0d0d0;
  --border-hover: #000000;
  --accent: #000000;
  --font-sans:
    "Noto Sans KR", "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* --- Layout --- */
.dashboard {
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 32px;
}

.dashboard-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 48px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--text-primary);
}

.dashboard-title {
  font-size: 1.5rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.dashboard-subtitle {
  font-size: 0.8rem;
  font-weight: 300;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.quick-links {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.quick-links-left {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.quick-links-right {
  display: flex;
  gap: 8px;
}

.quick-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  transition: all 0.2s ease;
}

.quick-link:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.quick-link-arrow {
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.quick-link:hover .quick-link-arrow {
  transform: translateX(3px);
}

.ai-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--text-primary);
  background: transparent;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.ai-btn:hover {
  background: var(--text-primary);
  color: var(--bg-primary);
}

.ai-btn-letter {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0;
}

/* --- Grid Layout --- */
.widget-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 24px;
}

/* Top Row: Clock + Weather side by side */
.top-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.widget-grid .widget--report {
  grid-column: 1 / 2;
  grid-row: 2 / 3;
  display: flex;
  flex-direction: column;
}

.widget-grid .widget--report .widget-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* --- Stock Grid (individual widgets) --- */
.stock-grid {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  /* The 5th widget spans full width at the bottom */
}

.stock-grid .widget--stock:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.widget--stock {
  display: flex;
  flex-direction: column;
  
}

.widget--stock .stock-widget-container {
  flex: 1;
}

/* --- Widget Card --- */
.widget {
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  padding: 0;
  transition: border-color 0.3s ease;
  animation: fadeInUp 0.6s ease both;
}

.widget:hover {
  border-color: var(--border-hover);
}

.widget:nth-child(1) {
  animation-delay: 0s;
}
.widget:nth-child(2) {
  animation-delay: 0.1s;
}
.widget:nth-child(3) {
  animation-delay: 0.2s;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.widget-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border-color);
}

.widget-header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.report-timestamp {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.05em;
}

.widget-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.widget-indicator {
  width: 6px;
  height: 6px;
  background: var(--text-primary);
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.3;
  }
}

.widget-body {
  padding: 24px;
}

/* --- Clock Widget --- */
.clock-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.clock-time {
  font-size: 4rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.clock-seconds {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--text-muted);
  vertical-align: super;
  margin-left: 4px;
}

.clock-date {
  text-align: right;
}

.clock-date-main {
  font-size: 1.2rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.clock-date-sub {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 4px;
}

/* --- Report Widget --- */
.report-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  max-height: 800px;
}

.report-list::-webkit-scrollbar {
  width: 4px;
}

.report-list::-webkit-scrollbar-track {
  background: transparent;
}

.report-list::-webkit-scrollbar-thumb {
  background: var(--border-color);
}

.report-item {
  padding: 16px 0;
  border-bottom: 1px solid var(--bg-secondary);
  transition: padding-left 0.2s ease;
  cursor: pointer;
}

.report-item:last-child {
  border-bottom: none;
}

.report-item:hover {
  padding-left: 8px;
}

.report-item a {
  text-decoration: none;
  color: inherit;
  display: block;
}

.report-category {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.report-title {
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--text-primary);
  transition: color 0.2s ease;
}

.report-item:hover .report-title {
  color: var(--text-secondary);
}

.report-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
}

.report-meta-divider {
  width: 1px;
  height: 10px;
  background: var(--border-color);
}

.report-summary {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  font-weight: 300;
}

.report-loading,
.report-error {
  text-align: center;
  padding: 40px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* --- Fortune Widget --- */
.widget--fortune {
  grid-column: 1 / -1;
}

.fortune-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.fortune-item {
  display: flex;
  align-items: baseline;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.fortune-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.fortune-category {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
  min-width: 52px;
}

.fortune-message {
  font-size: 0.9rem;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
}

.fortune-loading {
  text-align: center;
  padding: 24px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 300;
}

/* --- Stock Widget --- */
.stock-widget-container {
  height: 200px;
  overflow: hidden;
}

.stock-list {
  list-style: none;
}

.stock-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--bg-secondary);
}

.stock-item:last-child {
  border-bottom: none;
}

.stock-symbol {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stock-name {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 300;
  margin-top: 2px;
}

.stock-price {
  font-size: 1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.stock-change {
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 2px;
  text-align: right;
}

.stock-change.positive {
  color: #111;
}

.stock-change.negative {
  color: #666;
}

.stock-change.positive::before {
  content: "▲ ";
  font-size: 0.6rem;
}

.stock-change.negative::before {
  content: "▼ ";
  font-size: 0.6rem;
}

/* TradingView Widget Overrides */
.tradingview-widget-container {
  border: none !important;
}

/* --- Weather Widget --- */
.weather-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.weather-current {
  display: flex;
  align-items: center;
  gap: 16px;
}

.weather-icon {
  font-size: 2.8rem;
  line-height: 1;
}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
}

.weather-desc {
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-top: 4px;
}

.weather-details {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.weather-detail {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.75rem;
}

.weather-detail-label {
  color: var(--text-muted);
  font-weight: 300;
}

.weather-detail-value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.weather-forecast {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--bg-secondary);
  padding-top: 16px;
}

.forecast-day {
  flex: 1;
  text-align: center;
  padding: 0 8px;
  border-right: 1px solid var(--bg-secondary);
}

.forecast-day:last-child {
  border-right: none;
}

.forecast-label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.forecast-icon {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.forecast-temp {
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.forecast-high {
  font-weight: 600;
}

.forecast-low {
  color: var(--text-muted);
  font-weight: 300;
  margin-left: 4px;
}

.weather-loading {
  text-align: center;
  padding: 40px 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 300;
}

.weather-toggle {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.weather-toggle:hover {
  border-color: var(--text-primary);
  color: var(--text-primary);
}

/* --- Footer --- */
.dashboard-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

  .widget-grid .widget--report {
    grid-column: 1 / -1;
    grid-row: auto;
  }

  .stock-grid {
    grid-column: 1 / -1;
    grid-row: auto;
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 900px) {
  .dashboard {
    padding: 24px 16px;
  }

  .top-row {
    grid-template-columns: 1fr;
  }

  .stock-grid {
    grid-template-columns: 1fr 1fr;
  }

  .clock-time {
    font-size: 2.8rem;
  }

  .clock-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .clock-date {
    text-align: left;
  }

  .dashboard-header {
    flex-direction: column;
    gap: 8px;
  }
}

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

@media (max-width: 480px) {
  .clock-time {
    font-size: 2rem;
  }

  .widget-body {
    padding: 16px;
  }

  .widget-header {
    padding: 12px 16px;
  }

  .weather-current {
    flex-wrap: wrap;
  }

  .weather-details {
    margin-left: 0;
    flex-direction: row;
    gap: 16px;
    margin-top: 8px;
    width: 100%;
  }
}

