:root {
  --bg-color: #0f0f0f;
  --text-color: #f0f0f0;
  --accent-color: #e50914; /* Netflix Red-ish / Studio accent */
  --card-bg: #1f1f1f;
  --font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --input-bg: #333;
  --input-border: #444;
}

body {
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: var(--font-family);
  margin: 0;
  padding: 0;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* Fix mobile scroll stuck issues */
.main {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 80px; /* Space for footer/mobile nav if needed */
}

/* Studio/Login Styling */
.auth-box {
  background: rgba(0, 0, 0, 0.75);
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.5);
  padding: 40px;
  max-width: 450px;
  width: 100%;
  margin: 10vh auto;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.login-title {
  color: #fff;
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 25px;
  text-align: center;
}

.input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  color: #fff;
  padding: 16px;
  border-radius: 4px;
  font-size: 1rem;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 15px;
  transition: border-color 0.2s;
}

.input:focus {
  border-color: var(--accent-color);
  outline: none;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #fff;
  border: none;
  padding: 16px;
  width: 100%;
  border-radius: 4px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

/* Glowing Hover Effect */
.btn-primary:hover {
  background-color: #f40612;
  box-shadow: 0 0 15px var(--accent-color), 0 0 25px rgba(229, 9, 20, 0.6);
  transform: translateY(-2px);
}

.login-btn-row {
    display: flex;
    gap: 15px;
}

/* Player Styling Updates */
#playerTitle {
    width: 100%;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    pointer-events: none; /* Let clicks pass through */
    z-index: 10002;
}

/* Search Input Styling */
#searchInput:focus {
    width: 250px !important;
    border-color: var(--accent-color) !important;
    box-shadow: 0 0 8px rgba(229, 9, 20, 0.5);
    outline: none;
}

/* --- FORCE FULLSCREEN OVERLAY VIDEO --- */
#videoOverlay {
    padding: 0 !important; /* Remove any padding constraints */
    margin: 0 !important;
    overflow: hidden !important;
}

#videoOverlay .plyr {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important; /* Remove radius for full immersion */
    position: absolute !important;
    top: 0; left: 0;
}

#videoOverlay video,
#videoOverlay .plyr__video-wrapper {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important; /* Ensure video scales to fit without cropping */
}

/* --- REFINED PLAYER CONTROLS --- */

/* Unified Close Button */
.close-player-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10003;
    background: #cc0000;
    color: #000; /* Black text */
    border: none; /* Removed white border */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%; /* Perfect circle */
    cursor: pointer;
    font-weight: 600; /* Semi-bold */
    font-size: 1.2rem; /* Larger X */
    box-shadow: 0 2px 8px rgba(0,0,0,0.4);
    transition: all 0.2s;
}

.close-player-btn:hover {
    background: #ff0000;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(255, 0, 0, 0.4);
}

/* Unified Action Buttons (Prev, Next, Resume, Popup) */
.btn-next-episode,
.btn-resume,
#nextEpPopupBtn {
    background: #22c55e !important;
    color: #000000 !important;
    border: none !important;
    padding: 10px 20px !important; /* Reduced padding (smaller) */
    border-radius: 999px !important; /* Fully rounded */
    font-size: 0.95rem !important; /* Slightly smaller font */
    font-weight: 500 !important; /* Removed bold (was 800) */
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
    text-transform: none !important; /* Removed caps */
    min-width: unset !important; /* Allow shrinking */
}

.btn-next-episode:hover,
.btn-resume:hover,
#nextEpPopupBtn:hover {
    background: #16a34a !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 20px rgba(34, 197, 94, 0.4);
}

/* Specific Tweak for Popup Button Position */
#nextEpPopupBtn {
    padding: 12px 24px !important; /* Keep popup slightly larger than inline btns */
    font-size: 1rem !important;
}

/* Force Space Between for Bottom Bar Controls */
#playerBottomBar {
    justify-content: space-between !important;
}
