:root {
  --bg-gradient: linear-gradient(135deg, #1e1e24 0%, #2a2a35 100%);
  --glass-bg: rgba(30, 30, 36, 0.6);
  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-highlight: rgba(255, 255, 255, 0.05);
  --text-primary: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --shadow-lg: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  --font-main: "Inter", "Segoe UI", sans-serif;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  color: var(--text-primary);
  background: black url('../img/background.jpg') no-repeat center center fixed;
  background-size: cover;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  display: flex;
  justify-content: center;
  align-items: center;
}

#app {
  width: 95vw;
  height: 90vh;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  grid-template-rows: 1fr 1.5fr;
  gap: 20px;
  grid-template-areas:
    "clock weather"
    "news news";
}

/* Glassmorphism Card Style */
.card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 30px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  background: rgba(30, 30, 36, 0.7);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.4);
}

/* Card Specifics */
#clock-card {
  grid-area: clock;
  justify-content: center;
  align-items: flex-start;
}

#weather-card {
  grid-area: weather;
  justify-content: space-between;
}

#news-card {
  grid-area: news;
}

/* Clock Styles */
.time-display {
  font-size: 8rem;
  font-weight: 200;
  line-height: 1;
  letter-spacing: -4px;
  margin-bottom: 0.5rem;
}

.date-display {
  font-size: 1.8rem;
  font-weight: 400;
  color: var(--text-secondary);
}

/* Weather Styles */
.weather-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.location-name {
  font-size: 2rem;
  font-weight: 600;
}

.weather-current {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 20px 0;
}

.current-temp {
  font-size: 5rem;
  font-weight: 300;
}

.weather-icon-large {
  font-size: 4rem;
  /* Placeholder for icon font or img */
}

.weather-forecast {
  display: flex;
  gap: 20px;
  border-top: 1px solid var(--glass-border);
  padding-top: 20px;
}

.forecast-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

/* News Styles */
.news-header {
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 15px;
}

.news-header h2 {
  font-size: 1.5rem;
  font-weight: 500;
}

.news-list {
  list-style: none;
  overflow-y: auto;
  flex-grow: 1;
  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: var(--glass-border) transparent;
}

.news-list::-webkit-scrollbar {
  width: 6px;
}

.news-list::-webkit-scrollbar-thumb {
  background-color: var(--glass-border);
  border-radius: 3px;
}

.news-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  cursor: pointer;
  transition: background 0.2s;
  border-radius: 8px;
}

.news-item:hover {
  background: var(--glass-highlight);
}

.news-title {
  font-size: 1.1rem;
  font-weight: 400;
  flex-grow: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-right: 20px;
}

.news-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-width: 150px;
  text-align: right;
}

/* Settings Button */
#settings-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
  font-size: 1.5rem;
  z-index: 100;
}

#settings-btn:hover {
  opacity: 1;
}

/* Loading/Error States */
.loading {
  color: var(--text-secondary);
  font-style: italic;
}

.error-msg {
  color: #ff6b6b;
  font-size: 0.9rem;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  width: 400px;
  max-width: 90%;
  background: var(--glass-bg);
  /* Reuse glass background */
  background-color: #2a2a35;
  /* Solid fallback */
}

.form-group {
  margin: 15px 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.form-group label {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.form-group select,
.form-group input {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.3);
  color: white;
  font-family: inherit;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

button.btn-primary,
button.btn-secondary {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

button.btn-primary {
  background: white;
  color: black;
}

button.btn-secondary {
  background: transparent;
  color: white;
  border: 1px solid var(--glass-border);
}

button.btn-primary:hover {
  background: #ddd;
}

button.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}