* {
  box-sizing: border-box;
  font-family: 'Montserrat', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
  url('bg2.webp'),
    radial-gradient(
      ellipse at center,
      rgba(255,255,255,0.02) 0%,
      rgba(0,0,0,0.4) 70%
    ),
    linear-gradient(
      180deg,
      #1f2328 0%,
      #171a1f 100%
    );
    background-repeat: no-repeat;
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  color: white;
  min-height: 100vh;
  overflow-x: hidden;
}

.page-wrapper {
  max-width: 70%;
  margin: 0 auto;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  grid-template-rows: 1fr auto;
  gap: 40px;
  align-items: center;
  position: relative;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n' x='0%25' y='0%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' /%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
  background-size: 200px 200px;
  opacity: 0.4;
  mix-blend-mode: soft-light;
}

.damascus-time {
  display: flex;
  flex-direction: column;
  gap: 30px;
  grid-column: 1;
  grid-row: 1;
  align-self: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(215, 25, 32, 0.35);
  border-radius: 16px;
  padding: 30px 25px;
}

.now-playing-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.now-playing-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.now-playing-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #d71920;
}

.now-playing-subtitle {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.time-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.time-main {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 48px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
}

.time-period-desktop {
  font-size: 20px;
  font-weight: 600;
  color: #d71920;
  letter-spacing: 1px;
  animation: pulse-opacity 2.5s ease-in-out infinite;
}

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

.time-location-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  grid-column: 2;
  grid-row: 1;
}

.logo {
  width: 240px;
  height: auto;
  animation: breathe 4s infinite ease-in-out;
}

@keyframes breathe {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.02);
  }
}

.station-name {
  margin: 0;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.7) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.slogan {
  margin: -18px 0 0 0;
  font-size: 14px;
  font-weight: 400;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.live-badge {
  background: #d71920;
  padding: 10px 24px 10px 20px;
  border-radius: 24px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 1.5px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.live-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  background: white;
  border-radius: 50%;
  animation: blink 2s infinite ease-in-out;
}

@keyframes blink {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.2;
  }
}

.play-btn-wrapper {
  position: relative;
  width: 100px;
  height: 100px;
}

.play-btn {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: none;
  background: #d71920;
  color: white;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(215, 25, 32, 0.4);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
}

.play-btn:hover {
  transform: scale(1.05);
}

.play-btn svg {
  width: 36px;
  height: 36px;
}

.loading-ring {
  position: absolute;
  top: -6px;
  left: -6px;
  width: 112px;
  height: 112px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-in-out;
  animation: spin 1s linear infinite;
}

body.loading .loading-ring {
  opacity: 1;
}

.volume-control {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 280px;
}

.volume-icon {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.2s ease, transform 0.2s ease;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.volume-icon:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: scale(1.1);
}

.volume-icon svg {
  width: 22px;
  height: 22px;
}

.volume-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 18px;
  background: transparent;
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  background: #d71920;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
  margin-top: -6px;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: #d71920;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.volume-slider::-moz-range-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-webkit-slider-runnable-track {
  background: linear-gradient(
    to right,
    #d71920 0%,
    #d71920 var(--volume-percent, 100%),
    rgba(255, 255, 255, 0.2) var(--volume-percent, 100%),
    rgba(255, 255, 255, 0.2) 100%
  );
  height: 6px;
  border-radius: 3px;
}

.volume-slider::-moz-range-track {
  background: linear-gradient(
    to right,
    #d71920 0%,
    #d71920 var(--volume-percent, 100%),
    rgba(255, 255, 255, 0.2) var(--volume-percent, 100%),
    rgba(255, 255, 255, 0.2) 100%
  );
  height: 6px;
  border-radius: 3px;
  border: none;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.waveform {
  display: flex;
  align-items: flex-end;
  height: 60px;
  gap: 8px;
  opacity: 0.6;
}

.waveform span {
  width: 6px;
  height: 15px;
  background: #ccc;
  border-radius: 4px;
}

/* Waveform bars are controlled by JavaScript using Web Audio API */
.waveform span {
  transition: height 0.1s ease;
}

footer {
  padding: 20px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  grid-column: 1 / -1;
  grid-row: 2;
}

footer a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

footer a:hover {
  color: rgba(255, 255, 255, 0.9);
  transform: translateY(-2px);
}

footer a svg {
  width: 20px;
  height: 20px;
}

.damascus-weather {
  display: flex;
  flex-direction: column;
  gap: 25px;
  grid-column: 3;
  grid-row: 1;
  align-self: center;
  background: rgba(255, 255, 255, 0.05);
  backdrop-filter: blur(3px);
  border: 1px solid rgba(215, 25, 32, 0.35);
  border-radius: 16px;
  padding: 30px 25px;
}

.weather-header {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
}

.weather-today {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding-bottom: 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-today-icon {
  width: 64px;
  height: 64px;
  color: rgba(255, 255, 255, 0.8);
}

.weather-today-temp {
  font-size: 56px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.95);
  line-height: 1;
}

.weather-today-condition {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: capitalize;
}

.weather-forecast {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.weather-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.weather-day-abbr {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  min-width: 25px;
  flex: 1;
}

.weather-icon {
  width: 28px;
  height: 28px;
  color: rgba(255, 255, 255, 0.7);
  flex-shrink: 0;
  flex: 1;
}

.weather-temp {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
  text-align: right;
  flex: 1;
}

.weather-attribution {
  font-size: 9px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.3);
  text-align: center;
  margin-top: 10px;
  padding-top: 15px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.weather-attribution a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s ease;
}

.weather-attribution a:hover {
  color: rgba(255, 255, 255, 0.8);
}

.weather-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  padding: 40px 0;
}

.weather-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #d71920;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

.weather-loading-text {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 1px;
}

.mobile-info {
  display: none;
}

@media (max-width: 1024px) {
  .page-wrapper {
    max-width: 100%;
    grid-template-columns: 1fr;
  }

  .damascus-time,
  .damascus-weather {
    display: none;
  }

  .container {
    grid-column: 1;
  }

  .mobile-info {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }

  .mobile-info-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px 20px;
  }

  .mobile-location {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
  }

  .mobile-weather-inline {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-weather-icon {
    width: 24px;
    height: 24px;
    color: rgba(255, 255, 255, 0.8);
  }

  .mobile-weather-temp {
    font-size: 16px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
  }

  .mobile-time-display {
    display: flex;
    align-items: baseline;
    gap: 6px;
  }

  .mobile-time-value {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    font-family: 'Courier New', monospace;
  }

  .time-period-mobile {
    font-size: 14px;
    font-weight: 600;
    color: #d71920;
    letter-spacing: 0.5px;
    animation: pulse-opacity 2.5s ease-in-out infinite;
  }

  .play-btn-wrapper {
    width: 80px;
    height: 80px;
  }

  .play-btn {
    width: 80px;
    height: 80px;
  }

  .play-btn svg {
    width: 28px;
    height: 28px;
  }

  .loading-ring {
    width: 92px;
    height: 92px;
  }

  .logo {
    width: 180px;
  }

  .waveform {
    height: 40px;
  }

  .station-name {
    font-size: 24px;
  }

  .slogan {
    font-size: 12px;
  }

  .container {
    gap: 20px;
  }
}
