/* CSS Reset - replaces MUI CssBaseline */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  margin: 0;
  min-height: 100vh;
  line-height: 1.5;
  font-synthesis: none;
  font-weight: 400;
  font-family: "Chivo", sans-serif !important;
}

h1, h2, h3, h4, h5, h6 {
  font-family: "Russo One", sans-serif !important;
}
/* App theme containers */
.app-dark {
  min-height: 100vh;
  background-color: #0a1929;
  color: rgba(255, 255, 255, 0.87);
}

.app-light {
  min-height: 100vh;
  background-color: #ffffff;
  color: rgba(0, 0, 0, 0.87);
}
.widget-grid {
  display:flex;
  flex-direction: column;
  gap: 20px;
  justify-content: space-evenly;
}
.widget-row {
  display:flex;
  justify-content: flex-start;
  flex-direction: row;
  gap: 10px;
}
.news-widget {
  min-width: 25%;
  max-width: 49%;
  flex-grow: 2;
}
.widget-row.condensed {
  justify-content: space-evenly;
}
.news-widget img {
  width: 70%;
  margin: 10px auto;
}

a {
  font-weight: 500;
  color: #90caf9;
  text-decoration: inherit;
}

a:hover {
  color: #64b5f6;
}

.app-light a {
  color: #1976d2;
}

.app-light a:hover {
  color: #1565c0;
}

h1 {
  font-size: 3.2em;
  line-height: 1.1;
}

button {
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0.6em 1.2em;
  font-size: 1em;
  font-weight: 500;
  font-family: inherit;
  background-color: #1a1a1a;
  cursor: pointer;
  transition: border-color 0.25s;
}

button:hover {
  border-color: #646cff;
}

button:focus,
button:focus-visible {
  outline: 4px auto -webkit-focus-ring-color;
}

.app-light button {
  background-color: #f5f5f5;
  color: rgba(0, 0, 0, 0.87);
}

/* Input/TextField resets - form elements need explicit inheritance */
input, textarea {
  font-family: inherit;
}

/* Chat Interface Styles */
.chat-header {
  margin-left: 8px;
  font-size: 0.875rem;
}

.chat-placeholder {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin: 0;
}

.app-light .chat-placeholder {
  color: rgba(0, 0, 0, 0.6);
}

.chat-message-user {
  display: inline-block;
  padding: 12px;
  border-radius: 8px;
  max-width: 70%;
  background-color: #1976d2;
  color: white;
  font-size: 0.875rem;
}

.chat-message-assistant {
  display: inline-block;
  padding: 12px;
  border-radius: 8px;
  max-width: 70%;
  background-color: #424242;
  color: white;
  font-size: 0.875rem;
}

.app-light .chat-message-assistant {
  background-color: #e0e0e0;
  color: #000000;
}

/* Dashboard Styles */
.loading-status {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  margin: 0;
}

.app-light .loading-status {
  color: rgba(0, 0, 0, 0.6);
}

.token-usage-box {
  margin-bottom: 16px;
  padding: 16px;
  background-color: #1e2a35;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.app-light .token-usage-box {
  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.token-usage-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin: 0;
}

.app-light .token-usage-text {
  color: rgba(0, 0, 0, 0.6);
}

.token-usage-caption {
  color: rgba(255, 255, 255, 0.38);
  font-size: 0.75rem;
}

.app-light .token-usage-caption {
  color: rgba(0, 0, 0, 0.38);
}

.cache-info-box {
  margin-bottom: 16px;
  padding: 16px;
  background-color: #2e7d32;
  color: white;
  border-radius: 4px;
  border: 1px solid #1b5e20;
}

.app-light .cache-info-box {
  background-color: #4caf50;
  color: white;
  border: 1px solid #388e3c;
}

.cache-info-text {
  font-size: 0.875rem;
  margin: 0;
}

.cache-info-caption {
  font-size: 0.75rem;
  opacity: 0.9;
}

/* Widget Styles */
.widget-title {
  font-size: 2rem;
  font-weight: 500;
  margin: 0 0 8px 0;
  line-height: 1.6;
}

.widget-error {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin: 0;
}

.app-light .widget-error {
  color: rgba(0, 0, 0, 0.6);
}

.widget-info {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.875rem;
  margin: 0 0 8px 0;
}

.app-light .widget-info {
  color: rgba(0, 0, 0, 0.6);
}

.widget-caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  margin: 0;
}

.app-light .widget-caption {
  color: rgba(0, 0, 0, 0.6);
}

/* Briefing Widget Styles */
.briefing-text {
  white-space: pre-line;
  line-height: 1.7;
  font-size: 1.05rem;
  margin: 8px 0 0 0;
}

/* Weather Widget Styles */
.weather-error-message {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  margin: 0;
}

.app-light .weather-error-message {
  color: rgba(0, 0, 0, 0.6);
}

.weather-location-caption {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.75rem;
  display: block;
  margin-top: 8px;
}

.app-light .weather-location-caption {
  color: rgba(0, 0, 0, 0.6);
}

.weather-temp-large {
  font-size: 3rem;
  font-weight: 300;
  line-height: 1;
}

.weather-temp-unit {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 4px;
}

.app-light .weather-temp-unit {
  color: rgba(0, 0, 0, 0.6);
}

.weather-description-text {
  color: rgba(255, 255, 255, 0.6);
  font-size: 1rem;
  margin: 8px 0 0 0;
}

.app-light .weather-description-text {
  color: rgba(0, 0, 0, 0.6);
}

.weather-section-title {
  font-size: 0.875rem;
  font-weight: 600;
  margin: 0 0 16px 0;
  font-family: "Russo One", sans-serif;
}

.weather-forecast-day {
  font-size: 0.75rem;
  display: block;
  margin-bottom: 8px;
}

.weather-forecast-temp-max {
  font-size: 0.875rem;
  font-weight: 500;
  margin: 8px 0 0 0;
}

.weather-forecast-temp-min {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.app-light .weather-forecast-temp-min {
  color: rgba(0, 0, 0, 0.6);
}

/* News Widget Styles */
.news-title {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 0.875rem;
}

.news-author {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-left: 8px;
  align-self: center;
}

.app-light .news-author {
  color: rgba(0, 0, 0, 0.6);
}

.news-date {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 4px;
}

.app-light .news-date {
  color: rgba(0, 0, 0, 0.6);
}

.news-description {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
  display: -webkit-box;
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.app-light .news-description {
  color: rgba(0, 0, 0, 0.6);
}

/* Debug Panel Styles */
.debug-title {
  font-size: 1.25rem;
  font-weight: 500;
  margin: 0 0 16px 0;
}

.debug-warning {
  color: #ed6c02;
  font-size: 0.75rem;
  margin-top: 8px;
  display: block;
}

.app-light .debug-warning {
  color: #e65100;
}

/* Quick Links Bar */
.quick-links-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px 12px;
  background-color: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  align-items: center;
}

.app-light .quick-links-bar {
  background-color: rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.quick-link-btn {
  display: inline-block;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  border-radius: 4px;
  background-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
  transition: background-color 0.2s, color 0.2s;
}

.quick-link-btn:hover {
  background-color: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.app-light .quick-link-btn {
  background-color: rgba(0, 0, 0, 0.06);
  color: rgba(0, 0, 0, 0.6);
}

.app-light .quick-link-btn:hover {
  background-color: rgba(0, 0, 0, 0.12);
  color: rgba(0, 0, 0, 0.87);
}

/* Webpage Widget Styles */
.webpage-summary {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin: 0 0 12px 0;
}

.app-light .webpage-summary {
  color: rgba(0, 0, 0, 0.6);
}

.webpage-item-summary {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.4;
  margin-top: 4px;
}

.app-light .webpage-item-summary {
  color: rgba(0, 0, 0, 0.54);
}
