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

html, body {
	position: relative;
	width: 100%;
	height: 100%;
}

body {
	color: #333;
	margin: 0;
	padding: 8px;
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	background-image: url("/Beautiful_Pond_Background-607.jpg");
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	width: 100vw;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	font-family: system-ui, sans-serif;
	padding: 0;
	position: relative;
}

/* Background overlay for opacity control */
body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.0);
  z-index: -1;
  transition: background-color 0.3s ease;
}

a {
	color: rgb(0,100,200);
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

a:visited {
	color: rgb(0,80,160);
}

label {
	display: block;
}

input, button, select, textarea {
	font-family: inherit;
	font-size: inherit;
	-webkit-padding: 0.4em 0;
	padding: 0.4em;
	margin: 0 0 0.5em 0;
	box-sizing: border-box;
	border: 1px solid #ccc;
	border-radius: 2px;
}

input:disabled {
	color: #ccc;
}

button {
	color: #333;
	background-color: #f4f4f4;
	outline: none;
}

button:disabled {
	color: #999;
}

button:not(:disabled):active {
	background-color: #ddd;
}

button:focus {
	border-color: #666;
}

/* --- Video wrapper --- */
#videoWrapper {
  position: relative;
  width: 90vw;
  max-width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
  margin-bottom: 12px;
  background-color: #000;
  min-height: 480px;
  max-height: 95vh;
  contain: layout size;
  z-index: 0;
}

video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: block;
  background: #000;
  object-fit: contain;
}

/* --- Loading placard --- */
#placard {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: clamp(1rem, 2.5vw, 1.75rem);
  text-align: center;
  padding: 1rem 2rem;
  backdrop-filter: blur(2px);
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 1;
}

/* Loading progress bar styles */
.loading-progress-container {
  width: 80%;
  max-width: 300px;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.2);
  margin-top: 20px;
  border-radius: 2px;
  overflow: hidden;
}

.loading-progress-bar {
  height: 100%;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.8);
  transition: width 0.2s ease;
  border-radius: 2px;
}

.loading-status {
  font-size: 0.9rem;
  margin-top: 8px;
  opacity: 0.8;
}

/* --- LIVE badge and button --- */
#liveBtn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  padding: 6px 12px;
  border-radius: 4px;
  background: rgba(255, 0, 0, 0.8);
  color: #fff;
  font-size: 0.9rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
  z-index: 1;
}

#liveBtn.dim {
  background: rgba(100, 100, 100, 0.7);
}

#liveBtn:hover:not(.dim) {
  background: rgba(255, 0, 0, 1);
}

/* --- Quality selector --- */
#qualitySelector {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  color: #fff;
  padding: 6px;
  font-size: 0.9rem;
  z-index: 2;
  display: flex;
  gap: 6px;
  align-items: center;
  transition: opacity 0.3s;
}

#qualitySelector.hidden {
  opacity: 0;
  pointer-events: none;
}

.quality-btn {
  background: rgba(80, 80, 80, 0.5);
  border: none;
  color: #fff;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: background 0.2s;
}

.quality-btn:hover {
  background: rgba(100, 100, 100, 0.8);
}

.quality-btn.active {
  background: rgba(0, 123, 255, 0.7);
}

/* --- Social link --- */
#social {
  text-align: center;
}

#social a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.5);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: background 0.2s;
}

#social a:hover {
  background: rgba(0, 0, 0, 0.7);
}

#social svg {
  width: 18px;
  height: 18px;
  fill: #ff0000;
}


  /* Import global styles */
  @import './global.css';

  /* --- Base Structure (from global.css or here) --- */
  /* Assuming body, #mainContainer, #videoWrapper, #social are styled in global.css */

  /* --- Placard --- */
  #placard.svelte-ft6kwx {
    position: absolute;
    inset: 0;
    display: flex; /* Use flex instead of relying on visibility prop */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: clamp(1rem, 2.5vw, 1.75rem);
    text-align: center;
    padding: 1rem 2rem;
    backdrop-filter: blur(3px);
    pointer-events: none; /* Allow clicks through to video */
    transition: opacity 0.4s ease;
    z-index: 1;
    opacity: 1; /* Default visible */
  }

  .loading-progress-container.svelte-ft6kwx {
    width: 80%;
    max-width: 300px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.2);
    margin-top: 20px;
    border-radius: 2px;
    overflow: hidden;
  }

  .loading-progress-bar.svelte-ft6kwx {
    height: 100%;
    width: 0%; /* Controlled by JS */
    background-color: rgba(255, 255, 255, 0.8);
    transition: width 0.3s ease;
    border-radius: 2px;
  }

  .loading-status.svelte-ft6kwx {
    font-size: 0.9rem;
    margin-top: 8px;
    opacity: 0.8;
    min-height: 1.2em; /* Prevent layout shift */
  }

  /* --- Video --- */
  video.svelte-ft6kwx {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    object-fit: contain;
  }

  /* Hide default progress bar slightly unless interacting (from index.html) */
   video.svelte-ft6kwx::-webkit-media-controls-timeline {
      opacity: 0.3;
      transition: opacity 0.5s ease;
    }
    video.svelte-ft6kwx:hover::-webkit-media-controls-timeline,
    video.svelte-ft6kwx:focus::-webkit-media-controls-timeline { /* Added focus */
      opacity: 1;
    }
    video.svelte-ft6kwx::-webkit-media-controls-panel {
      background-image: linear-gradient(transparent, rgba(0, 0, 0, 0.6)) !important;
    }


  /* --- Live Button --- */
  #liveBtn.svelte-ft6kwx {
    position: absolute;
    bottom: 12px;
    right: 12px;
    padding: 6px 12px;
    border-radius: 4px;
    background: rgba(100, 100, 100, 0.7); /* Default dim */
    color: #fff;
    font-size: 0.9rem;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    z-index: 1;
  }

  #liveBtn.live.svelte-ft6kwx { /* Class added when live */
    background: rgba(255, 0, 0, 0.8);
  }

  #liveBtn.live.svelte-ft6kwx:hover {
    background: rgba(255, 0, 0, 1);
  }

  /* --- Quality Selector --- */
  #qualitySelector.svelte-ft6kwx {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 4px;
    color: #fff;
    padding: 6px;
    font-size: 0.9rem;
    z-index: 2;
    display: flex;
    gap: 6px;
    align-items: center;
    transition: opacity 0.3s;
    opacity: 1; /* Default visible */
  }

  .quality-btn.svelte-ft6kwx {
    background: rgba(80, 80, 80, 0.5);
    border: none;
    color: #fff;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: background 0.2s;
  }

  .quality-btn.svelte-ft6kwx:hover {
    background: rgba(100, 100, 100, 0.8);
  }

  .quality-btn.active.svelte-ft6kwx {
    background: rgba(0, 123, 255, 0.7);
    font-weight: bold;
  }

  /* --- Metrics Display --- */
  #metrics-display.svelte-ft6kwx {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 9px; /* Slightly larger */
    padding: 3px 6px;
    font-family: monospace;
    z-index: 10;
    text-align: left;
    line-height: 1.3;
    backdrop-filter: blur(2px);
    white-space: nowrap; /* Prevent wrapping */
    overflow: hidden;
    text-overflow: ellipsis; /* Add ellipsis if text overflows */
  }

  /* --- Mobile Adjustments (assuming from global.css or here) --- */
   @media (max-width: 768px) {
      #liveBtn.svelte-ft6kwx {
        bottom: 24px; /* More padding from bottom */
        right: 16px;
      }
      #qualitySelector.svelte-ft6kwx {
        top: 8px;
        right: 8px;
        font-size: 0.8rem;
      }
      .quality-btn.svelte-ft6kwx {
        padding: 3px 6px;
        font-size: 0.7rem;
      }
       #placard.svelte-ft6kwx {
         font-size: 1rem;
      }
      #metrics-display.svelte-ft6kwx {
         font-size: 8px;
         padding: 2px 5px;
      }
   }


