:root {
  --primary-bg-dark: #181818;
  --primary-bg-light: #f7f7f7;
  --container-dark: #232323;
  --container-light: #fff;
  --accent: #e50914;
  --input-dark: #2c2c2c;
  --input-light: #f0f0f0;
  --text-dark: #fff;
  --text-light: #181818;
  --shadow-dark: 0 4px 24px rgba(0,0,0,0.18);
  --shadow-light: 0 4px 24px rgba(0,0,0,0.08);
}

body {
  font-family: 'Inter', Arial, sans-serif;
  background: var(--primary-bg-dark);
  color: var(--text-dark);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background 0.3s, color 0.3s;
}

body.light {
  background: var(--primary-bg-light);
  color: var(--text-light);
}

.header {
  width: 100%;
  background: var(--container-dark);
  color: var(--text-dark);
  text-align: center;
  padding: 18px 0 10px 0;
  font-size: 1.2rem;
  letter-spacing: 1px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
  position: sticky;
  top: 0;
  z-index: 20;
}

body.light .header {
  background: var(--container-light);
  color: var(--text-light);
}

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
}

.player-container {
  width: 100%;
  max-width: 420px;
  margin: 28px auto 0 auto;
  background: var(--container-dark);
  padding: 18px 10px 16px 10px;
  border-radius: 14px;
  box-shadow: var(--shadow-dark);
  transition: background 0.3s, box-shadow 0.3s;
  display: flex;
  flex-direction: column;
  align-items: center;
}

body.light .player-container {
  background: var(--container-light);
  box-shadow: var(--shadow-light);
}

#player {
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: 12px;
  overflow: hidden;
  margin: 14px 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.10);
}

input[type="text"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: none;
  font-size: 1rem;
  margin-bottom: 10px;
  background: var(--input-dark);
  color: var(--text-dark);
  transition: background 0.3s, color 0.3s;
  box-sizing: border-box;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

body.light input[type="text"] {
  background: var(--input-light);
  color: var(--text-light);
}

button, select {
  padding: 10px 16px;
  border-radius: 12px;
  border: none;
  background: #3a3a3a;
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, box-shadow 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  outline: none;
  font-weight: 600;
  margin: 0 0 0 0;
}

button:active, select:active {
  background: #555;
  transform: scale(0.98);
}

body.light button, body.light select {
  background: #e0e0e0;
  color: #181818;
}

.primary-btn {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  margin-bottom: 10px;
}
.primary-btn:active {
  background: #b00610;
}

.controls {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 6px;
  background: transparent;
  border-radius: 10px;
  padding: 0;
}

#playPauseBtn {
  font-size: 1.5rem;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.10);
  transition: background 0.2s, transform 0.1s;
  margin: 0;
}
#playPauseBtn:active {
  background: #b00610;
  transform: scale(0.96);
}

input[type="range"] {
  width: 90px;
  accent-color: var(--accent);
  margin: 0 4px;
  background: transparent;
  height: 32px;
}

#pipBtn, #shareBtn {
  background: #222;
  color: #fff;
  border-radius: 7px;
  padding: 10px 16px;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  outline: none;
}
#pipBtn:active, #shareBtn:active {
  background: #444;
  transform: scale(0.98);
}
body.light #pipBtn, body.light #shareBtn {
  background: #e0e0e0;
  color: #181818;
}
#pipBtn:disabled, #shareBtn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Pop-up Button */
.popup-btn {
  margin-top: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  border-radius: 12px;
  padding: 14px 0;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  transition: background 0.2s, transform 0.1s;
  width: 98%;
  font-size: 1.08rem;
}
.popup-btn:active {
  background: #b00610;
  transform: scale(0.98);
}

/* Pop-up Modal */
.popup-modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background: rgba(0,0,0,0.45);
  align-items: center;
  justify-content: center;
}

.popup-modal.active {
  display: flex;
}

.popup-content {
  background: var(--container-dark);
  color: var(--text-dark);
  padding: 32px 24px 24px 24px;
  border-radius: 18px;
  min-width: 260px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  position: relative;
  text-align: center;
  font-size: 1.08rem;
}
body.light .popup-content {
  background: var(--container-light);
  color: var(--text-light);
}
.close-popup {
  position: absolute;
  top: 14px; right: 18px;
  font-size: 2rem;
  font-weight: bold;
  color: #888;
  cursor: pointer;
  transition: color 0.2s;
}
.close-popup:hover {
  color: var(--accent);
}

.footer {
  width: 100%;
  background: var(--container-dark);
  color: var(--text-dark);
  text-align: center;
  padding: 14px 0 10px 0;
  font-size: 0.98rem;
  letter-spacing: 0.5px;
  font-weight: 500;
  position: sticky;
  bottom: 0;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
}

body.light .footer {
  background: var(--container-light);
  color: var(--text-light);
}

/* --- Professional Mobile UI --- */
@media (max-width: 600px) {
  .header, .footer {
    font-size: 1.1rem;
    padding: 14px 0 10px 0;
    letter-spacing: 0.5px;
  }
  .player-container {
    max-width: 100vw;
    margin: 10px 0 0 0;
    border-radius: 0;
    box-shadow: none;
    padding: 8px 0 14px 0;
    background: var(--container-dark);
  }
  body.light .player-container {
    background: var(--container-light);
  }
  #player {
    border-radius: 16px;
    margin: 12px 0;
    box-shadow: 0 4px 24px rgba(0,0,0,0.10);
  }
  .controls {
    flex-direction: column;
    gap: 14px;
    padding: 10px 0 0 0;
    background: transparent;
    border-radius: 16px;
    width: 100%;
  }
  button, select {
    width: 98%;
    font-size: 1.08rem;
    padding: 16px 0;
    margin: 0 auto;
    border-radius: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    font-weight: 600;
    letter-spacing: 0.2px;
  }
  #playPauseBtn {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
  input[type="range"] {
    width: 100%;
    margin: 0;
    accent-color: var(--accent);
    height: 36px;
  }
  input[type="text"] {
    font-size: 1.08rem;
    padding: 14px 12px;
    margin-bottom: 12px;
    border-radius: 12px;
    width: 98%;
    background: var(--input-dark);
    color: var(--text-dark);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  }
  body.light input[type="text"] {
    background: var(--input-light);
    color: var(--text-light);
  }
  .popup-btn {
    width: 98%;
    padding: 16px 0;
    font-size: 1.08rem;
    border-radius: 14px;
    margin-top: 14px;
  }
  .popup-content {
    min-width: 0;
    width: 94vw;
    padding: 24px 10px 18px 10px;
    border-radius: 20px;
    font-size: 1.1rem;
  }
  .close-popup {
    top: 10px;
    right: 16px;
    font-size: 2.2rem;
  }
}

/* Placeholder color for all browsers */
::-webkit-input-placeholder { color: #aaa; }
::-moz-placeholder { color: #aaa; }
:-ms-input-placeholder { color: #aaa; }
::placeholder { color: #aaa; }
