/* ==========================================================================
   Woerden Live - Design System & Stylesheet
   ========================================================================== */

/* Design Tokens */
:root {
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* Premium HSL Color Palette */
  --primary-hue: 28; /* Warm orange sunset tone */
  --primary: hsl(var(--primary-hue), 95%, 52%);
  --primary-hover: hsl(var(--primary-hue), 95%, 45%);
  --primary-glow: hsla(var(--primary-hue), 95%, 52%, 0.35);
  
  --bg-card: rgba(18, 18, 24, 0.65);
  --bg-modal: rgba(22, 22, 28, 0.85);
  
  --text-main: hsl(210, 15%, 95%);
  --text-muted: hsl(210, 10%, 70%);
  --text-dark: hsl(210, 15%, 15%);
  
  --border-white: rgba(255, 255, 255, 0.08);
  --border-white-hover: rgba(255, 255, 255, 0.16);
  --border-primary: hsla(var(--primary-hue), 95%, 52%, 0.4);
  
  --shadow-main: 0 24px 64px -16px rgba(0, 0, 0, 0.65);
  --shadow-inset: inset 0 1px 1px rgba(255, 255, 255, 0.1);
  --transition-smooth: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  
  --radius-xl: 24px;
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

/* Reset & Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  font-family: var(--font-body);
  color: var(--text-main);
  background-color: #0b0b0f;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Fullscreen Background Layer with Ken Burns & Vignette */
.bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  overflow: hidden;
  pointer-events: none;
}

.bg-image {
  position: absolute;
  top: -5%;
  left: -5%;
  width: 110%;
  height: 110%;
  background-image: url('woerden_sunset.png');
  background-size: cover;
  background-position: center;
  filter: blur(2px) brightness(0.85);
  animation: kenBurns 40s ease-in-out infinite alternate;
}

.bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Radial vignette + dark linear bottom gradient for depth */
  background: 
    radial-gradient(circle, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%),
    linear-gradient(180deg, rgba(11, 11, 15, 0.1) 0%, rgba(11, 11, 15, 0.85) 100%);
}

@keyframes kenBurns {
  0% {
    transform: scale(1.0) translate(0, 0);
  }
  100% {
    transform: scale(1.08) translate(-1%, -1%);
  }
}

/* App Layout & Centered Flex Grid */
.app-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  position: relative;
  z-index: 2;
}

.container {
  width: 100%;
  max-width: 960px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.8s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

/* Glassmorphic Hero Card */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-main), var(--shadow-inset);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 80px -12px rgba(0, 0, 0, 0.8), var(--shadow-inset);
}

/* Card Header Styles */
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 28px;
  height: 28px;
  color: var(--primary);
  filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, hsl(210, 10%, 80%) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Status & Live Indicators */
.status-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.3);
  padding: 6px 14px;
  border-radius: 50px;
  border: 1px solid var(--border-white);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: #ef4444;
  border-radius: 50%;
  position: relative;
  display: inline-block;
}

.pulse-dot::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

.status-label {
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: #ef4444;
}

.viewer-count {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 10px;
  margin-left: 2px;
}

/* Responsive 16:9 Video Player */
.player-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.05);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.iframe-container {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  height: 0;
  background-color: #050508;
}

.iframe-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Card Footer & Stream Details */
.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
}

.stream-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stream-title {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 600;
  color: #fff;
}

.stream-description {
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text-muted);
}

/* Interactive Buttons */
.stream-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition-smooth);
}

.btn-primary {
  background-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 16px var(--primary-glow);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--primary-glow);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background-color: rgba(255, 255, 255, 0.06);
  border-color: var(--border-white);
  color: var(--text-main);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--border-white-hover);
  transform: translateY(-2px);
}

.btn-secondary:active {
  transform: translateY(0);
}

.btn-icon {
  width: 42px;
  height: 42px;
  padding: 0;
  background-color: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-white);
  color: var(--text-muted);
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.btn-icon:hover {
  background-color: rgba(255, 255, 255, 0.12);
  border-color: var(--border-white-hover);
  color: #fff;
  transform: translateY(-2px) rotate(30deg);
}

.btn-icon:active {
  transform: translateY(0);
}

/* App Footer copyright */
.app-footer {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.app-footer kbd {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid var(--border-white);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: inherit;
  font-size: 10px;
}

/* Modal Overlay Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(6, 6, 8, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

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

.modal-card {
  width: 100%;
  max-width: 500px;
  background: var(--bg-modal);
  border: 1px solid var(--border-white);
  border-radius: var(--radius-xl);
  box-shadow: 0 32px 80px rgba(0,0,0,0.8);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.modal-overlay.active .modal-card {
  transform: scale(1) translateY(0);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 600;
  color: #fff;
}

.btn-close {
  background: transparent;
  border: 0;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Forms & Inputs */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-group label {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.form-group input, 
.form-group textarea {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-white);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  color: #fff;
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: var(--transition-smooth);
}

.form-group input:focus, 
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

.form-help {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* Modal Presets Grid */
.preset-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 16px;
}

.preset-label {
  font-family: var(--font-heading);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-main);
}

.presets-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.preset-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-white);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: var(--font-heading);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--border-white-hover);
  color: #fff;
}

.preset-btn.active {
  background: rgba(var(--primary-hue), 95%, 52%, 0.15);
  border-color: var(--primary);
  color: var(--primary);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 8px;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.toast {
  background: rgba(18, 18, 24, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-left: 4px solid var(--primary);
  padding: 12px 20px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 13.5px;
  font-weight: 500;
  animation: slideIn 0.3s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

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

.toast.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes fadeOut {
  from { opacity: 1; transform: scale(1); }
  to { opacity: 0; transform: scale(0.9); }
}

/* Responsive Media Queries */
@media (max-width: 768px) {
  .app-wrapper {
    padding: 20px 12px;
  }
  
  .glass-card {
    padding: 16px;
    gap: 16px;
  }
  
  .brand-title {
    font-size: 20px;
  }
  
  .status-badge-container {
    padding: 4px 10px;
  }
  
  .viewer-count {
    display: none; /* Hide on small mobile to save space */
  }
  
  .card-footer {
    flex-direction: column;
    gap: 16px;
  }
  
  .stream-controls {
    width: 100%;
    justify-content: flex-end;
  }
  
  .btn {
    flex: 1;
  }
  
  .presets-grid {
    grid-template-columns: 1fr;
  }
}
