/* ========================================================================
   CSS Reset (Eric Meyer 2.0 + HTML5 display-role reset)
   ======================================================================== */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, caption,
tbody, tfoot, thead, tr, th, td, article,
aside, canvas, details, embed, figure,
figcaption, footer, header, hgroup, menu,
nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

/* HTML5 display-role reset for older browsers */
article, aside, details, figcaption, figure,
footer, header, hgroup, menu, nav, section {
  display: block;
}

body {
  line-height: 1;
}

ol, ul {
  list-style: none;
}

blockquote, q {
  quotes: none;
}

blockquote:before, blockquote:after,
q:before, q:after {
  content: '';
  content: none;
}

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* Box sizing reset */
*, *:before, *:after {
  -webkit-box-sizing: border-box;
     -moz-box-sizing: border-box;
          box-sizing: border-box;
}

/* ========================================================================
   Your Custom Styles (with vendor prefixes)
   ======================================================================== */

/* Body background & font */
body {
  font-family:'Segoe UI', Verdana, sans-serif;
  background:#eaeaea;
}

/* Station list - responsive desktop layout */
.station-list {
  max-width: 1440px;
  margin: 2px auto;
  padding:25px 25px 280px 25px;
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 10px;
  overflow-y:auto;
}

.station-item {
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  gap:20px;
  background:#fff;
  padding:10px;
  -webkit-border-radius:15px;
          border-radius:15px;
  border:2px solid #a0a0a0;
  cursor:pointer;
  -webkit-transition: all .2s;
     -moz-transition: all .2s;
       -o-transition: all .2s;
          transition: all .2s;
  height:110px;
}
.station-item:hover {
  -webkit-transform: translateY(-3px);
      -ms-transform: translateY(-3px);
          transform: translateY(-3px);
  -webkit-box-shadow: 0 4px 15px rgba(0,0,0,.1);
          box-shadow: 0 4px 15px rgba(0,0,0,.1);
  border-color:#222;
  background:#fff2c5;
}
.station-item.active {
  border-color:#222;
  background:#ffc1c1;
}
.station-item.playing {
  border-color:#222;
  background:#a8ffb9;
}
.station-thumb {
  width:90px;
  height:90px;
  -webkit-border-radius:8px;
          border-radius:8px;
  object-fit:cover;
}
.station-details { flex:1; }
.station-name {
  font-weight:600;
  font-size:20px;
  color:#2d3436;
  word-wrap:break-word;
}
.country {
  font-size:20px;
  color:#888;
  margin-top:5px;
}

/* Player container */
.radio-player {
  position:fixed;
  bottom:0;
  left:0;
  right:0;
  margin:16px;
  background:#222228;
  padding:10px 10px;
  -webkit-box-shadow: 0 -4px 15px rgba(0,0,0,.3);
          box-shadow: 0 -4px 15px rgba(0,0,0,.3);
  -webkit-border-radius:15px;
          border-radius:15px;
  z-index:1000;
}

/* Top row */
.station-info {
  position:relative;
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  gap:20px;
}
.station-logo {
  width:150px;
  height:150px;
  -webkit-border-radius:12px;
          border-radius:12px;
  object-fit:cover;
  background:#e0e0e0;
}
.station-text { flex:1; min-width:150px; }
.station-title {
  font-size:3.5rem;
  font-weight:800;
  color:#ffc400;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.station-country {
  font-size:2.5rem;
  color:#fff;
  margin-top:4px;
}
.digital-clock {
  position:absolute;
  top:50%;
  right:50px;
  -webkit-transform:translateY(-50%);
      -ms-transform:translateY(-50%);
          transform:translateY(-50%);
  font-family:verdana;
  font-size:4.5rem;
  font-weight:900;
  color:#0dff00;
  white-space:nowrap;
}

/* Controls row */
.player-controls {
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  gap:20px;
  margin-top:10px;
  flex-wrap:nowrap;
}
.player-controls > .loading-status-container {
  flex:1;
  min-width:200px;
  height:30px;
}

/* Loading & status */
.loading-status-container {
  position:relative;
  background:red;
  -webkit-border-radius:4px;
          border-radius:4px;
  overflow:hidden;
}
.loading-bar {
  height:100%;
  width:0%;
  background: linear-gradient(to right, red 0%, gold 50%, lime 100%);
  -webkit-transition:width 0.3s ease;
     -moz-transition:width 0.3s ease;
       -o-transition:width 0.3s ease;
          transition:width 0.3s ease;
}
.status-text {
  position:absolute;
  top:0;
  left:50%;
  -webkit-transform:translateX(-50%);
      -ms-transform:translateX(-50%);
          transform:translateX(-50%);
  font-size:1rem;
  font-weight:700;
  line-height:30px;
  color:#fff;
}

/* Play/stop button */
.playstop-btn {
  width:52px;
  height:52px;
  cursor:pointer;
  filter:invert(1);
}

/* Volume */
.volume-bar {
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  gap:10px;
}
#volume-slider {
  -webkit-appearance:none;
  -moz-appearance:none;
  appearance:none;
  width:180px;
  height:10px;
  background:repeating-linear-gradient(-45deg,#444,#444 5px,#666 5px,#666 10px);
  -webkit-border-radius:6px;
          border-radius:6px;
  outline:none;
}
#volume-slider::-webkit-slider-thumb {
  -webkit-appearance:none;
  width:12px;
  height:16px;
  background:#fff;
  border-radius:3px;
  cursor:pointer;
  margin-top:-3px;
}
#volume-slider::-moz-range-thumb {
  width:12px;
  height:16px;
  background:#fff;
  border-radius:3px;
  cursor:pointer;
}
#volume-percent {
  width:40px;
  text-align:right;
  font-size:1rem;
  font-weight:700;
  color:#fff;
}

/* Sleep timer */
.sleep-timer-control {
  display:-webkit-box;
  display:-ms-flexbox;
  display:flex;
  -webkit-box-align:center;
      -ms-flex-align:center;
          align-items:center;
  gap:6px;
  min-width:100px;
}
.sleep-timer-control select {
  background:#333;
  color:#fff;
  border:none;
  -webkit-border-radius:4px;
          border-radius:4px;
  padding:4px;
  font-size:1rem;
  font-weight:700;
}
.sleep-timer-control span {
  width:40px;
  text-align:right;
  font-size:1.25rem;
  font-weight:700;
  color:#ff0000;
  margin-right:32px;
}

/* Hide audio element */
#audio-element { display:none; }

/* ========================================================================
   Mobile Overrides (screens ≤768px)
   ======================================================================== */
@media (max-width: 768px) {
  /* Single-column list with bottom padding */
  .station-list {
    grid-template-columns: 1fr;
    padding: 15px 15px 300px 15px;
  }

  /* Hide clock & volume */
  .digital-clock,
  .volume-bar {
    display: none !important;
  }

  /* Wrap controls */
  .player-controls {
    -webkit-flex-wrap: wrap;
        -ms-flex-wrap: wrap;
            flex-wrap: wrap;
  }

  /* Responsive logo */
  .station-logo {
    width: 100px !important;
    height: 100px !important;
  }

  /* Full text visibility */
  .station-title {
    font-size: 2rem !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
  }
  .station-country {
    font-size: 1.5rem !important;
    white-space: normal !important;
    overflow: visible !important;
  }
}
