/* ---------- Global ---------- */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
               Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: #F9FAFB;
  color: #1F2937;
}
.app-shell {
  max-width: 450px;
  margin: 0 auto;
  background: #FFF;
  min-height: 100vh;
  box-shadow: 0 0 20px rgba(0,0,0,0.05);
}

/* ---------- Header ---------- */
header {
  padding: 0.25rem 1rem;
  border-bottom: 1px solid #E5E7EB;
  display: flex;
  align-items: center;
}
header > * {
  margin: 0;
}
.logo-img {
  display: block;
  height: 64px;
  width: auto;
  margin: 0;
}
/* ADD THIS RULE */
header a {
  line-height: 0; /* Prevents extra space around the linked image */
}

/* ---------- Navigation ---------- */
nav {
  display: flex;
  justify-content: space-around;
  padding: 0.5rem;
  border-top: 1px solid #E5E7EB;
  position: fixed;
  bottom: 0;
  width: 100%;
  max-width: 450px;
  background: #FFF;
}
nav a {
  color: #6B7280;
  text-decoration: none;
  padding: 0.5rem;
  font-weight: 500;
}
nav a.active {
  color: #3B82F6;
  border-bottom: 2px solid #3B82F6;
}

/* ---------- Main / Search ---------- */
main {
  padding: 0.5rem 1rem 60px;
}
.search-bar {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  margin: -0.25rem 0 1rem;
  box-sizing: border-box;
}

/* ---------- Filters ---------- */
.filter-tracks {
  display: flex;
  overflow-x: auto;
  margin-bottom: 1rem;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.filter-tracks::-webkit-scrollbar {
  display: none;
}
.filter-tracks button {
  background: #E5E7EB;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  margin-right: 0.5rem;
  font-size: 0.875rem;
  cursor: pointer;
  white-space: nowrap;
}
.filter-tracks button.active {
  background: #3B82F6;
  color: #FFF;
}

/* ---------- Video Cards ---------- */
.video-card {
  margin-bottom: 1.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: pointer;
  /* CHANGED: 'position: relative' is no longer needed here */
}
.video-card img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  background: #E5E7EB;
  display: block;
}
.video-card-info {
  padding: 1rem;
}
.video-card-info h3 {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  line-height: 1.3;
}
.video-card-info p {
  margin: 0;
  color: #6B7280;
  font-size: 0.875rem;
}

/* CHANGED: The old .fav-btn class has been removed */

/* ---------- Video Player Page ---------- */
.video-player {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  height: 0;
  overflow: hidden;
  background: #000;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}
.video-player iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
.support-button {
  display: block;
  width: 100%;
  background: #16A34A;
  color: #FFF;
  text-align: center;
  padding: 0.75rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: bold;
  margin-bottom: 1rem;
}
.rating-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 1rem;
}
.rating-controls button {
  background: #E5E7EB;
  border: none;
  font-size: 1.5rem;
  padding: 0.5rem 1rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: background-color 0.2s;
  /* This style now applies to the new fav button as well */
}
.rating-controls button:hover {
  background-color: #D1D5DB;
}
.rating-controls button.active {
  background-color: #3B82F6;
  color: white;
}
/* New style for the favorited button on the player page */
#fav-btn.active {
    background-color: #ef4444; /* red-500 */
}

.description-box {
  background: #F9FAFB;
  padding: 1rem;
  border-radius: 0.5rem;
}
.description-box h4 {
  margin-top: 0;
}
/* --- ADD THIS TO THE END OF YOUR style.css FILE --- */

/* ---------- Opt-In Popup ---------- */
#optin-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease-in-out;
  pointer-events: none;
}
#optin-overlay.visible {
  opacity: 1;
  pointer-events: auto;
}

.optin-modal {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
  text-align: center;
  position: relative;
}
.optin-modal h3 {
  margin-top: 0;
  color: #1F2937;
}
.optin-modal p {
  color: #6B7280;
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}
.optin-modal .close-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #9CA3AF;
  cursor: pointer;
}
.optin-modal input[type="text"] {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  box-sizing: border-box;
}
.optin-modal .consent-row {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: #6B7280;
  margin-bottom: 1.5rem;
}
.optin-modal .consent-row input {
  margin-right: 0.5rem;
}
.optin-modal .submit-btn {
  width: 100%;
  background: #3B82F6;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-weight: bold;
  cursor: pointer;
}
.optin-modal .submit-btn:disabled {
  background: #9CA3AF;
  cursor: not-allowed;
}