*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --green-dark: #0d1f0d;
  --green-mid: #1a3a1a;
  --green-brand: #009846;
  --green-light: #00c45a;
  --green-glow: rgba(0, 152, 70, 0.3);
  --gold: #d4a843;
  --gold-light: #f0d080;
  --white: #ffffff;
  --text-secondary: rgba(255, 255, 255, 0.7);
  --card-bg: rgba(0, 0, 0, 0.4);
  --card-border: rgba(0, 152, 70, 0.2);
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  font-family: var(--font-main);
  color: var(--white);
  background: linear-gradient(135deg, var(--green-dark), var(--green-mid));
}

.container {
  display: grid;
  grid-template-columns: 1fr 420px;
  height: 100vh;
  width: 100vw;
  gap: 0;
}

/* ============= MAIN SLIDE ============= */
.main-slide {
  position: relative;
  overflow: hidden;
  background: var(--green-dark);
  background-size: cover;
  background-position: center;
  transition: background-image 1.2s ease-in-out;
  min-height: 0;
}

.slide-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 40px 60px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
  z-index: 1;
}

.slide-title {
  font-size: 2.2rem;
  font-weight: 300;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

/* ============= SIDEBAR ============= */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  background: linear-gradient(180deg, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
  overflow-y: auto;
  min-width: 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Clock */
.clock-card {
  text-align: center;
  padding: 12px 14px;
}

.clock-time {
  font-size: 2.8rem;
  font-weight: 200;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.clock-date {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 3px;
}

/* Weather */
.weather-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.weather-icon img {
  width: 48px;
  height: 48px;
  display: block;
}

.weather-main {
  flex: 1;
}

.weather-temp {
  font-size: 2.2rem;
  font-weight: 200;
  line-height: 1;
}

.weather-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-transform: capitalize;
  margin-top: 2px;
}

.weather-secondary {
  text-align: right;
  font-size: 0.8rem;
  color: var(--text-secondary);
  white-space: nowrap;
}

.weather-secondary span {
  display: block;
}

/* AQI */
.aqi-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.aqi-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.aqi-value {
  font-size: 1.5rem;
  font-weight: 200;
  line-height: 1;
}

.aqi-level {
  font-size: 0.8rem;
  font-weight: 500;
  margin-left: auto;
}

.aqi-bar {
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 4px;
}

.aqi-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s ease, background 0.8s ease;
}

.aqi-parts {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Eco card */
.eco-label {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.eco-text {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.9);
  min-height: 2.5em;
  transition: opacity 0.4s ease;
}

/* Quote card */
.quote-text {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  font-style: italic;
  min-height: 2.5em;
  transition: opacity 0.4s ease;
}

.quote-author {
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 4px;
  text-align: right;
}

/* Red Book card */
.redbook-label {
  font-size: 0.75rem;
  color: #e74c3c;
  font-weight: 600;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.redbook-content {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.9);
  min-height: 2.5em;
  transition: opacity 0.4s ease;
}

/* News card */
.news-card {
  flex: 0 0 auto;
  overflow: hidden;
}

.news-label {
  font-size: 0.75rem;
  color: var(--gold);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.news-scroll {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  max-height: 4.2em;
  overflow: hidden;
}

.news-item {
  padding: 2px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

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

.news-item-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Events card */
.events-card {
  overflow: hidden;
}

.events-label {
  font-size: 0.75rem;
  color: var(--green-light);
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.events-scroll {
  font-size: 0.85rem;
  line-height: 1.4;
  color: rgba(255,255,255,0.85);
  max-height: 4.2em;
  overflow: hidden;
}

.event-item {
  padding: 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-item::before {
  content: '›';
  color: var(--green-light);
  margin-right: 4px;
}

/* ============= VIDEO OVERLAY ============= */
.video-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.video-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.video-wrapper {
  width: 90vw;
  height: 90vh;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

.video-wrapper iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-close-btn {
  position: fixed;
  top: 20px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 2rem;
  cursor: pointer;
  z-index: 1001;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.video-close-btn:hover {
  background: rgba(255, 0, 0, 0.3);
  transform: scale(1.1);
}

/* Floating Moscow 24 button */
.m24-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 28px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 30px;
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 0 24px var(--green-glow);
}

.m24-btn:hover {
  background: var(--green-brand);
  border-color: var(--green-brand);
  box-shadow: 0 0 40px var(--green-glow);
  transform: scale(1.05);
}

.m24-btn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #ff4444;
  box-shadow: 0 0 8px rgba(255, 68, 68, 0.6);
}

.m24-btn-text {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.m24-btn-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: #ff4444;
}

/* ============= RESPONSIVE ============= */
@media (max-width: 1600px) {
  .container {
    grid-template-columns: 1fr 360px;
  }

  .slide-title { font-size: 1.6rem; }
  .clock-time { font-size: 2.4rem; }
  .weather-temp { font-size: 1.8rem; }
}

/* ============= ANIMATIONS ============= */
@keyframes fadeSlideIn {
  from { opacity: 0; transform: scale(1.02); }
  to { opacity: 1; transform: scale(1); }
}

.main-slide.slide-changing {
  animation: fadeSlideIn 1.2s ease-out;
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 8px var(--green-glow); }
  50% { box-shadow: 0 0 20px var(--green-glow); }
}

.card:first-child {
  animation: pulseGlow 4s ease-in-out infinite;
}

/* scrollbar */
.sidebar::-webkit-scrollbar {
  width: 4px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: var(--green-brand);
  border-radius: 2px;
}
