/* -------------------------------------------------------------------------- */
/* IMPORTS & FONTS                                                           */
/* -------------------------------------------------------------------------- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Montserrat:wght@600;700;800&display=swap');

/* -------------------------------------------------------------------------- */
/* VARIABLES                                                                 */
/* -------------------------------------------------------------------------- */
:root {
  /* Brand Identity */
  --brand-primary:      #003c63;
  --brand-primary-dark: #002742;
  --brand-accent:       #f2b632;
  
  /* Derived Colors */
  --brand-accent-glow:  rgba(242, 182, 50, 0.4);

  /* Light Mode UI */
  --ui-bg:              #f8fafc;
  --ui-panel-bg:        #ffffff;
  --ui-text-main:       #0f172a; /* Dark Slate */
  --ui-text-muted:      #64748b;
  --ui-border:          #e2e8f0;
  --ui-shadow-lg:       0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

  /* Typography */
  --font-body:          'Inter', system-ui, -apple-system, sans-serif;
  --font-heading:       'Montserrat', system-ui, -apple-system, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ui-bg:              #020617;
    --ui-panel-bg:        #0f172a;
    --ui-text-main:       #f8fafc;
    --ui-text-muted:      #94a3b8;
    --ui-border:          #1e293b;
    --ui-shadow-lg:       0 10px 15px -3px rgba(0, 0, 0, 0.5);
  }
}

/* -------------------------------------------------------------------------- */
/* RESET & BASE                                                              */
/* -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-body);
  background-color: var(--ui-bg);
  color: var(--ui-text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-top: 0;
  color: var(--ui-text-main);
}

a { color: inherit; text-decoration: none; transition: color 0.2s ease; }

/* -------------------------------------------------------------------------- */
/* HEADER & NAVIGATION (AGGRESSIVE GLASS)                                    */
/* -------------------------------------------------------------------------- */
.top-bar {
  background: var(--brand-primary-dark);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 0.25rem 0;
  position: relative;
  z-index: 101;
}

.top-bar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: flex-end;
  gap: 1.5rem;
}

.main-header {
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: all 0.3s ease;
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

@media (prefers-color-scheme: dark) {
  .main-header { 
    background: rgba(15, 23, 42, 0.75); 
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1rem;
}

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

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

.brand-logo { width: 52px; height: auto; }

.brand-text-main {
  display: block;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--brand-primary);
  line-height: 1.1;
}

.brand-text-sub {
  display: block;
  font-size: 0.85rem;
  color: var(--ui-text-muted);
  font-weight: 500;
}

@media (prefers-color-scheme: dark) {
  .brand-text-main { color: #fff; }
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 2rem;
  margin-top: 0.5rem;
}

.header-nav a:not(.header-button) {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ui-text-muted);
  padding: 0.5rem 0;
  border-bottom: 2px solid transparent;
}

.header-nav a:not(.header-button):hover {
  color: var(--brand-primary);
  border-bottom-color: var(--brand-accent);
}

/* Button Style */
.header-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  padding: 0.75rem 2.5rem; 
  min-width: 140px;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 800; 
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--brand-accent);
  color: var(--brand-primary-dark);
  border: 2px solid var(--brand-accent);
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.header-button:hover {
  transform: translateY(-2px);
  background-color: var(--brand-primary-dark);
  color: var(--brand-accent);
  border-color: var(--brand-primary-dark);
}

.mobile-menu-toggle { display: none; }

/* -------------------------------------------------------------------------- */
/* HERO SECTION                                                              */
/* -------------------------------------------------------------------------- */
.hero {
  background: radial-gradient(circle at top right, var(--brand-primary), var(--brand-primary-dark));
  color: #ffffff;
  padding: 4rem 1rem 5rem;
  position: relative;
  overflow: hidden;
}

/* Pattern overlay */
.hero::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: 
    linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), 
    linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 30px 30px;
  pointer-events: none;
  z-index: 1;
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

/* Back Link */
.hero-back-link { margin: 0 0 0.5rem; }
.hero-back-link a {
  font-size: 0.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85) !important;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.hero-back-link a:hover { color: #ffffff !important; }

/* Hero Title */
.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2.5vw, 1.75rem);
  font-weight: 800;
  line-height: 1.1;
  margin-top: 1rem;
  margin-bottom: 1.25rem;
  color: #ffffff !important; 
  text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

/* Hero Meta */
.hero-meta {
  font-size: 1.125rem;
  color: rgba(255, 255, 255, 0.95) !important;
  margin-bottom: 2rem;
  max-width: 50ch;
  line-height: 1.6;
}

.hero-note {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Video Card */
.hero-video-card {
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  overflow: hidden;
}

.hero-video-header {
  padding: 1rem 1.5rem;
  background: rgba(0, 0, 0, 0.4); 
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* View and like meta row (now below the video) */
.hero-video-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1.4rem 0.9rem;
  font-size: 0.9rem;
}

/* Specific styling when used under the player */
.hero-video-meta-below {
  background: linear-gradient(
    to bottom,
    rgba(15, 23, 42, 0.6),
    rgba(15, 23, 42, 0.85)
  );
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (max-width: 640px) {
  .hero-video-meta-below {
    padding: 0.7rem 1.1rem 0.75rem;
  }
}

/* Brighter play count */
.hero-view-count {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.96);
}

/* Push like button to the right when on the same row */
.hero-video-meta .like-button {
  margin-left: auto;
}


.like-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.9rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  background: rgba(15, 23, 42, 0.3);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
}

.like-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.like-icon-svg {
  width: 1.1rem;
  height: 1.1rem;
  fill: currentColor;
}

/* Optional: slightly different tone when liked */
.like-button.liked {
  background: rgba(248, 250, 252, 0.18);
  border-color: var(--brand-accent);
  color: #fefce8;
}

.like-button.liked .like-icon-svg {
  fill: currentColor;
}


.like-button:focus-visible {
  outline: 2px solid var(--brand-accent);
  outline-offset: 2px;
}

.status-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background-color: #4ade80; box-shadow: 0 0 10px #4ade80;
  display: inline-block; margin-right: 0.5rem;
}

/* Video Selector */
.video-selector {
  position: relative;
  margin-bottom: 2rem;
  width: 100%;
  transition: box-shadow 150ms ease, transform 150ms ease;
}

.video-selector-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
  color: rgba(255, 255, 255, 0.8);
}

/* Base select */
.video-selector select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-color: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.75rem;
  padding: 0.75rem 2.6rem 0.75rem 1rem;
  color: #ffffff;
  font-family: var(--font-body);
  font-size: 1rem;
  cursor: pointer;

  /* Chevron icon as background */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23ffffff' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 10px 10px;
  transition:
    background-color 140ms ease,
    border-color 140ms ease,
    box-shadow 140ms ease;
}

/* Older Edge / IE arrow removal */
.video-selector select::-ms-expand {
  display: none;
}

/* Hover state */
.video-selector select:hover {
  background-color: rgba(15, 23, 42, 0.7);
  border-color: rgba(255, 255, 255, 0.42);
}

/* Focus ring and subtle lift */
.video-selector select:focus {
  outline: none;
}

.video-selector:focus-within {
  box-shadow:
    0 0 0 1px rgba(251, 191, 36, 0.65),
    0 10px 28px rgba(0, 0, 0, 0.35);
  transform: translateY(-1px);
}

.video-selector:focus-within select {
  border-color: var(--brand-accent);
  background-color: rgba(15, 23, 42, 0.9);

  /* Accent arrow on focus */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23fbbf24' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

/* Dropdown list styling */
.video-selector optgroup {
  background: #0f172a;
  color: #fff;
}

/* Small-screen tweak */
@media (max-width: 640px) {
  .video-selector select {
    font-size: 0.95rem;
    padding: 0.65rem 2.4rem 0.65rem 0.9rem;
    border-radius: 0.6rem;
  }
}

/* -------------------------------------------------------------------------- */
/* VIDEO PLAYER                                                              */
/* -------------------------------------------------------------------------- */
.video-js { font-family: var(--font-heading); }
.video-js .vjs-big-play-button {
  background-color: var(--brand-primary); border: 2px solid rgba(255,255,255,0.8);
  border-radius: 50%; width: 80px; height: 80px; line-height: 76px;
  margin-left: -40px; margin-top: -40px; top: 50%; left: 50%;
  transition: transform 0.2s;
}
.video-js:hover .vjs-big-play-button {
  background-color: var(--brand-accent); border-color: #fff;
  color: var(--brand-primary-dark); transform: scale(1.1);
}
.video-js .vjs-control-bar { background: rgba(15, 23, 42, 0.9); }
.video-js .vjs-play-progress, .video-js .vjs-volume-level { background-color: var(--brand-accent); }

/* -------------------------------------------------------------------------- */
/* MAIN CONTENT                                                              */
/* -------------------------------------------------------------------------- */
.main-content {
  max-width: 1200px;
  margin: -3rem auto 4rem;
  padding: 0 1rem;
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 2rem;
}

.panel {
  background: var(--ui-panel-bg);
  border: 1px solid var(--ui-border);
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--ui-shadow-lg);
}

.panel-title {
  color: var(--brand-primary);
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--ui-border);
}

@media (prefers-color-scheme: dark) { .panel-title { color: var(--brand-accent); } }

/* DATA LIST (Key-Value pairs) */
.meta-list { padding: 0; list-style: none; }
.meta-list li {
  display: grid; grid-template-columns: 110px 1fr; gap: 1rem;
  padding: 0.75rem 0; border-bottom: 1px solid var(--ui-border);
  font-size: 0.95rem; align-items: baseline;
}
.meta-list li:last-child { border-bottom: none; }
.meta-list strong { color: var(--ui-text-muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }

/* HELP LIST (Bullet points) */
.help-list {
  padding-left: 1.25rem;
  list-style: disc;
  margin-top: 1rem;
  color: var(--ui-text-main);
}
.help-list li {
  margin-bottom: 0.75rem;
  line-height: 1.6;
}

/* FORM STYLING (Premium Inputs) */
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ui-text-muted);
  margin-bottom: 0.5rem;
}

.form-control {
  width: 100%;
  padding: 0.8rem 1rem;
  font-size: 1rem;
  font-family: var(--font-body);
  background: var(--ui-bg);
  border: 2px solid var(--ui-border);
  border-radius: 0.5rem;
  color: var(--ui-text-main);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(0, 60, 99, 0.1); /* Brand Primary Glow */
}

@media (prefers-color-scheme: dark) {
  .form-control {
    background: #0f172a;
    border-color: #334155;
  }
  .form-control:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 4px rgba(242, 182, 50, 0.1); /* Gold Glow in Dark Mode */
  }
}

/* Alerts */
.alert {
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  margin-top: 1.5rem;
  font-weight: 500;
  border-left: 4px solid currentColor;
}
.alert-info { background-color: #e0f2fe; color: #0369a1; }
.alert-error { background-color: #fee2e2; color: #b91c1c; }

/* -------------------------------------------------------------------------- */
/* RESPONSIVE                                                                */
/* -------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; gap: 2rem; }
  .main-content { grid-template-columns: 1fr; margin-top: 2rem; }
  .header-nav { display: none; }
  .mobile-menu-toggle {
    display: inline-flex; align-items: center;
    padding: 0.5rem 1rem; border-radius: 999px;
    border: 1px solid var(--ui-border);
  }
  body.mobile-nav-open .header-nav {
    display: flex; flex-direction: column;
    width: 100%; position: absolute; top: 100%; left: 0;
    background: var(--ui-panel-bg); padding: 1rem;
    box-shadow: var(--ui-shadow-lg);
  }
  .hero-video-meta {
    flex-direction: row;
    gap: 0.75rem;
  }
}
@media (max-width: 640px) {
  .hero { padding: 2.5rem 1rem 3rem; }
  .hero-title { font-size: 2rem; }
  .top-bar-inner { justify-content: center; }
  .login-page .hero-inner { display: flex; flex-direction: column-reverse; }
  
  .meta-list li { grid-template-columns: 1fr; gap: 0.25rem; }
}

.panel-body .disclaimer {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ui-text-muted);
}
