/* CSS Design Tokens & Reset - Updated for Next-Level Playout bumpers */
:root {
  --font-title: 'Outfit', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

  /* Premium HSL Color Palette */
  --bg-dark: #0a0d13;
  --bg-card: rgba(20, 26, 38, 0.65);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(99, 102, 241, 0.25);
  
  --primary-glow: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
  --primary: #6366f1;
  --primary-hover: #4f46e5;
  --secondary: #a855f7;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --text-inverse: #ffffff;
  
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.25), 0 10px 10px -5px rgba(0, 0, 0, 0.15);
  --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.15);
  
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* Vibrant Radial Background Glows */
.glow-bg {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(168, 85, 247, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(10, 13, 19, 1) 0%, rgba(5, 7, 10, 1) 100%);
  background-attachment: fixed;
}

/* Scrollbar Style */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* App Container */
.app-container {
  display: flex;
  flex-direction: column;
  max-width: 1280px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  min-height: 100vh;
  justify-content: space-between;
}

/* Header */
.app-header {
  text-align: center;
  margin-bottom: 3rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.logo-icon {
  font-size: 2.25rem;
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.5));
}

.logo h1 {
  font-family: var(--font-title);
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  background: linear-gradient(to right, #ffffff, #c7d2fe, #f3e8ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.tagline {
  color: var(--text-muted);
  font-size: 1.1rem;
  font-weight: 400;
  max-width: 600px;
  margin: 0 auto;
}

/* Main Layout */
.main-content {
  display: flex;
  flex-direction: column;
  gap: 3rem;
  flex-grow: 1;
}

/* Glassmorphism Cards */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  padding: 2rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.glass-card:hover {
  border-color: var(--border-glow);
}

/* Config Section */
.config-section {
  width: 100%;
}

.section-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

/* Custom Interactive Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.check-card {
  cursor: pointer;
  position: relative;
  display: block;
}

/* Hide standard input */
.check-card input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.check-card-content {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.25rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
}

/* Card hover effect */
.check-card:hover .check-card-content {
  transform: translateY(-4px);
  border-color: rgba(99, 102, 241, 0.4);
  background: rgba(255, 255, 255, 0.04);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* Checkbox Indicator */
.checkbox-indicator {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 20px;
  height: 20px;
  border: 2px solid var(--text-muted);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  background: transparent;
}

.checkbox-indicator::after {
  content: '';
  width: 6px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: transform 0.2s ease;
  margin-bottom: 2px;
}

/* Active checked styles */
.check-card input[type="checkbox"]:checked + .check-card-content {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.check-card input[type="checkbox"]:checked + .check-card-content .checkbox-indicator {
  background: var(--primary);
  border-color: var(--primary);
}

.check-card input[type="checkbox"]:checked + .check-card-content .checkbox-indicator::after {
  transform: rotate(45deg) scale(1);
}

.check-card .icon {
  font-size: 1.75rem;
  margin-bottom: 0.25rem;
  transition: transform 0.3s ease;
}

.check-card:hover .icon {
  transform: scale(1.1);
}

.check-card h3 {
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.check-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Action Area & Buttons */
.action-area {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.btn {
  font-family: var(--font-title);
  font-size: 1.1rem;
  font-weight: 600;
  padding: 1rem 2.5rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-decoration: none;
}

.btn-primary {
  background: var(--primary-glow);
  color: var(--text-inverse);
}

.btn-glow {
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4), 0 0 40px rgba(168, 85, 247, 0.2);
}

.btn-primary:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 25px rgba(99, 102, 241, 0.6), 0 0 50px rgba(168, 85, 247, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-icon {
  font-size: 0.9rem;
  transition: transform 0.3s ease;
}

.btn:hover .btn-icon {
  transform: translateX(3px);
}

/* Video Player Layout */
.player-section {
  width: 100%;
}

.player-wrapper {
  max-width: 960px;
  margin: 0 auto;
}

.player-bezel {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background-color: #000;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8), 0 0 80px rgba(99, 102, 241, 0.15);
  border: 4px solid rgba(255, 255, 255, 0.05);
}

/* Video Tag */
.bulletin-player {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  clip-path: inset(0 0 0 100%); /* Masker sluit de video volledig af aan de rechterzijde */
  z-index: 1;
  transition: clip-path 0.5s cubic-bezier(0.25, 1, 0.5, 1); /* Studio-grade wipe */
  display: block;
}

.bulletin-player.active {
  clip-path: inset(0 0 0 0);
  z-index: 2;
}

.bulletin-player.transitioning {
  clip-path: inset(0 0 0 0); /* Trekt het masker volledig open */
  z-index: 3; /* Ligt bovenop de actieve player tijdens de wipe */
}

/* Transition Overlay (Fade out/in) */
.transition-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000000;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  transition: opacity 0.2s ease-in-out;
}

.transition-overlay.active {
  opacity: 1;
}

/* Welcome & Finished Overlay Screens */
.player-screen-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 5;
  background: radial-gradient(circle at center, rgba(16, 22, 35, 0.95) 0%, rgba(10, 13, 19, 0.99) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease-in-out;
  cursor: pointer;
}

.player-screen-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.overlay-content {
  max-width: 480px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.25rem;
}

.pulsing-play-icon {
  width: 72px;
  height: 72px;
  background: var(--primary-glow);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  padding-left: 5px; /* Offset to visually center the play triangle */
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
  animation: pulse 2.5s infinite;
  transition: transform 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.player-screen-overlay:hover .pulsing-play-icon {
  transform: scale(1.08);
}

.pulsing-play-icon svg {
  width: 32px;
  height: 32px;
}

.player-screen-overlay h2 {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  background: linear-gradient(to right, #ffffff, #c7d2fe);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.player-screen-overlay p {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.5;
}

/* Custom Controls Overlay (Hover Active) */
.custom-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 1.5rem 1.5rem 1rem 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.85) 0%, rgba(0, 0, 0, 0.4) 70%, transparent 100%);
  z-index: 8;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
}

/* Show controls when hover player, unless it's the welcome/ended overlay screen */
.player-bezel:hover:not(:has(.player-screen-overlay.active)) .custom-controls {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.controls-row {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.control-btn {
  background: transparent;
  border: none;
  color: white;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.control-btn:hover {
  background-color: rgba(255, 255, 255, 0.15);
  transform: scale(1.08);
}

.control-btn svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.control-btn .hidden {
  display: none !important;
}

/* Custom Progress Bar */
.progress-bar-container {
  flex-grow: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  position: relative;
  overflow: hidden;
  transition: height 0.2s ease;
}

.progress-bar-container:hover {
  height: 6px;
}

.progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: var(--primary-glow);
  border-radius: 2px;
  transition: width 0.1s linear;
}

/* Ticker/News Banner (Broadcast styling) */
.ticker-banner {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 44px;
  background: rgba(10, 13, 19, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  z-index: 6;
  opacity: 0;
  transform: translateY(-10px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.ticker-banner.active {
  opacity: 1;
  transform: translateY(0);
}

.ticker-label {
  background: #ef4444;
  color: white;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  padding: 0 1rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 5px 0 15px rgba(239, 68, 68, 0.3);
}

.ticker-label::after {
  content: '';
  position: absolute;
  right: -8px;
  top: 0;
  border-top: 22px solid transparent;
  border-bottom: 22px solid transparent;
  border-left: 8px solid #ef4444;
}

.ticker-text-wrapper {
  flex-grow: 1;
  padding: 0 2rem;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.ticker-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: white;
  white-space: nowrap;
  animation: slideInText 0.4s ease-out;
}

.ticker-progress-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  margin-right: 1.5rem;
  box-shadow: 0 0 8px #ef4444;
  animation: pulseDot 1.5s infinite;
}

/* Footer */
.app-footer {
  text-align: center;
  margin-top: 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* Animations */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.7);
    transform: scale(1);
  }
  70% {
    box-shadow: 0 0 0 15px rgba(99, 102, 241, 0);
    transform: scale(1.05);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(99, 102, 241, 0);
    transform: scale(1);
  }
}

@keyframes pulseDot {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes slideInText {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive Scaling */
@media (max-width: 768px) {
  .app-container {
    padding: 1rem 0.5rem;
  }

  .app-header {
    margin-bottom: 1.5rem;
  }

  .logo h1 {
    font-size: 1.8rem;
  }

  .logo-icon {
    font-size: 1.8rem;
  }

  .tagline {
    font-size: 0.95rem;
  }

  .main-content {
    gap: 1.5rem;
  }

  .glass-card, .profile-card {
    padding: 1rem;
  }

  /* Profile Selection */
  .profile-header {
    gap: 0.5rem;
    margin-bottom: 0.5rem;
  }

  .profile-segmented-control {
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }

  .profile-btn {
    font-size: 0.85rem;
    padding: 0.6rem 0.75rem;
  }

  /* Checkbox Grid & Cards */
  .checkbox-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .check-card-content {
    padding: 1rem;
    gap: 0.5rem;
  }

  .check-card .icon {
    font-size: 1.4rem;
  }

  .check-card h3 {
    font-size: 0.95rem;
  }

  .check-card p {
    font-size: 0.8rem;
  }

  .checkbox-indicator {
    top: 0.75rem;
    right: 0.75rem;
    width: 18px;
    height: 18px;
  }

  /* Video Player & Bezel */
  .player-bezel {
    width: 100%;
    border-width: 2px;
  }

  /* Ticker Banner */
  .ticker-banner {
    height: 36px;
  }

  .ticker-label {
    font-size: 0.65rem;
    padding: 0 0.75rem;
  }

  .ticker-label::after {
    right: -6px;
    border-top: 18px solid transparent;
    border-bottom: 18px solid transparent;
    border-left: 6px solid #ef4444;
  }

  .ticker-text-wrapper {
    padding: 0 1rem;
  }

  .ticker-title {
    font-size: 0.85rem;
  }

  .ticker-progress-dot {
    width: 6px;
    height: 6px;
    margin-right: 1rem;
  }

  /* Custom Controls */
  .custom-controls {
    padding: 0.75rem 1rem 0.5rem 1rem;
  }

  .control-btn {
    width: 32px;
    height: 32px;
  }

  .control-btn svg {
    width: 16px;
    height: 16px;
  }

  .progress-bar-container {
    height: 3px;
  }

  .btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 2rem;
    font-size: 1rem;
  }
}

/* Diagnostic Audio Controls */
.diagnostic-controls {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.subsection-title {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.switches-row {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
}

.switch-container {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  user-select: none;
}

.switch-container input[type="checkbox"] {
  display: none;
}

.switch-slider {
  position: relative;
  width: 44px;
  height: 22px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 22px;
  transition: background-color 0.3s ease;
  border: 1px solid var(--border-color);
}

.switch-slider::before {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  bottom: 2px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-sm);
}

.switch-container input[type="checkbox"]:checked + .switch-slider {
  background-color: var(--primary);
  border-color: var(--primary);
}

.switch-container input[type="checkbox"]:checked + .switch-slider::before {
  transform: translateX(22px);
}

.switch-label {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
}

/* Profile Selection Section */
.profile-selection {
  width: 100%;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1.25rem;
  padding: 2rem;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.profile-header .section-title {
  margin-bottom: 0;
}

/* Minimal styling for inline text toggle button */
.text-btn {
  background: transparent;
  border: none;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.text-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.05);
}

.text-btn .btn-icon {
  font-size: 0.95rem;
  transition: transform 0.3s ease;
}

.text-btn:hover .btn-icon {
  transform: rotate(45deg);
}

/* Segmented Control style for Profile Selection */
.profile-segmented-control {
  display: flex;
  background: rgba(5, 7, 10, 0.4);
  border: 1px solid var(--border-color);
  padding: 4px;
  border-radius: 12px;
  width: 100%;
  gap: 4px;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.profile-btn {
  flex: 1;
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
  text-align: center;
}

.profile-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.03);
}

.profile-btn.active {
  background: var(--primary-glow);
  color: var(--text-inverse);
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.25), 0 0 20px rgba(168, 85, 247, 0.15);
}

/* Collapsible Config Section (#regie-kamer) */
#regie-kamer {
  display: none;
  opacity: 0;
}

#regie-kamer.open {
  display: block;
  animation: slideDownFadeIn 0.4s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes slideDownFadeIn {
  from {
    opacity: 0;
    transform: translateY(-15px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
