/* ========================================
   Core Layout & Typography
   ======================================== */
html, body {
  margin: 0;
  padding: 0;
  background-color: #fef3e9;
  font-family: 'Inter', sans-serif;
  color: #444444;
  min-height: 100vh;
  overflow-x: hidden;
}

#appContainer {
  background-color: #ffffff;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  border-radius: 1.5rem;
  max-width: 1400px;
}

/* ========================================
   HEADER
   ======================================== */
.header-container {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* Logo Container */
.logo-container {
  flex: 0 1 auto;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo-img {
  display: block;
  height: auto;
  max-height: 120px;
  width: auto;
  max-width: 100%;
  transition: transform 0.3s ease;
}

/* User Info */
.user-info-container {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
  gap: 0.25rem;
  min-width: 200px;
}

.user-info-container p {
  margin: 0;
  font-size: 0.875rem;
  white-space: nowrap;
}

.user-info-container .btn-link {
  font-size: 0.875rem;
  text-decoration: none;
  padding: 0;
}

.user-info-container .btn-link:hover {
  text-decoration: underline;
}

/* ========================================
   VIDEO WRAPPER - True 16:9 Aspect Ratio
   ======================================== */
.video-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%; /* 16:9 aspect ratio */
  background: #000;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Offline Overlay */
.offline-overlay {
  position: absolute;
  inset: 0;
  background: #111;
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  z-index: 10;
}

.offline-overlay img {
  max-width: 300px;
  width: 100%;
  height: auto;
  margin-bottom: 1.5rem;
}

.offline-overlay h3 {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}

.offline-overlay p {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #ccc;
}

.retry-btn {
  margin-top: 1rem;
  background: #0d9488;
  border: none;
  color: #fff;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.retry-btn:hover {
  background: #0f766e;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

/* ========================================
   SIDEBAR
   ======================================== */
.sidebar {
  background-color: #e6fffa;
  padding: 1rem;
  border-radius: 12px;
  max-height: 600px;
  overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: #99f6e4;
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: #0d9488;
}

.sidebar .list-group-item {
  border: none;
  padding: 0.75rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.25s ease;
  cursor: pointer;
  background-color: transparent;
}

.sidebar .list-group-item:hover {
  background-color: #ccfbf1;
  transform: translateX(4px);
}

.sidebar .list-group-item.active {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 100%);
  color: white;
  transform: translateX(6px);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.4);
}

/* ========================================
   CAMERA BUTTON GROUP
   ======================================== */
.camera-btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.camera-btn-group .btn {
  flex: 1 1 auto;
  min-width: 100px;
  transition: all 0.25s ease;
}

.camera-btn-group .btn.active {
  background-color: #0d9488;
  border-color: #0d9488;
  color: white;
}

/* ========================================
   BUTTONS
   ======================================== */
.btn-teal {
  background-color: #0d9488;
  border-color: #0f766e;
  color: white;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-teal:hover:not(:disabled) {
  background-color: #0f766e;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.4);
}

.btn-teal:active {
  transform: scale(0.96);
}

.btn-outline-teal {
  background-color: transparent;
  border: 2px solid #0d9488;
  color: #0d9488;
  font-weight: 600;
  transition: all 0.25s ease;
}

.btn-outline-teal:hover:not(:disabled) {
  background-color: #e6fffa;
  border-color: #0d9488;
  color: #0d9488;
  transform: translateY(-1px);
}

.btn-outline-teal:active {
  transform: scale(0.96);
}

.btn-outline-teal.active {
  background-color: #0d9488;
  border-color: #0d9488;
  color: white;
}

/* Feed Button - Special Styling */
#sponsorBtn {
  background-color: white;
  border: 2px solid #0d9488;
  color: #0d9488;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  animation: pulseBtn 2s ease-in-out infinite;
  min-height: 60px;
}

#sponsorBtn:hover:not(:disabled) {
  background-color: #f8f9fa;
  box-shadow: 0 6px 18px rgba(13, 148, 136, 0.3);
  transform: translateY(-2px);
}

#sponsorBtn:active {
  transform: scale(0.95);
}

#sponsorBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

@keyframes pulseBtn {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 8px 24px rgba(13, 148, 136, 0.4);
  }
}

/* Full Screen Button */
#fsBtnBelow {
  font-weight: 600;
  transition: all 0.25s ease;
}

#fsBtnBelow:hover:not(:disabled) {
  background-color: #e6fffa;
  transform: translateY(-1px);
}

#fsBtnBelow:active {
  transform: scale(0.96);
}

/* ========================================
   STATUS INDICATORS
   ======================================== */
.status-indicator {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-online {
  background-color: #28a745;
}

.status-offline {
  background-color: #dc3545;
}

.status-loading {
  background-color: #ffc107;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */
.text-teal {
  color: #0d9488 !important;
}

.bg-teal-light {
  background-color: #e6fffa !important;
}

/* ========================================
   CONFETTI ANIMATION
   ======================================== */
.confetti {
  position: fixed;
  width: 10px;
  height: 10px;
  background: #ff9e2c;
  border-radius: 50%;
  pointer-events: none;
  animation: fall linear forwards;
  z-index: 9999;
}

@keyframes fall {
  to {
    transform: translateY(120vh) rotate(720deg);
    opacity: 0;
  }
}

/* ========================================
   MOBILE RESPONSIVE (≤768px)
   ======================================== */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .logo-container {
    width: 100%;
  }

  .logo-img {
    max-height: 100px;
  }

  .user-info-container {
    width: 100%;
    align-items: center;
    text-align: center;
    min-width: auto;
  }

  .user-info-container > div {
    justify-content: center;
  }

  .sidebar {
    max-height: 300px;
    margin-bottom: 1rem;
  }

  #sponsorBtn {
    font-size: 1rem;
    padding: 0.75rem 1.5rem;
    min-height: 50px;
  }

  #sponsorBtn .btn-text {
    font-size: 0.95rem;
  }

  .camera-btn-group {
    flex-direction: column;
  }

  .camera-btn-group .btn {
    width: 100%;
    min-width: auto;
  }

  /* Hide offline image and button on mobile */
  .offline-overlay img {
    display: none;
  }

  .offline-overlay .retry-btn {
    display: none;
  }

  .offline-overlay h3 {
    font-size: 1.25rem;
  }

  .offline-overlay {
    padding: 1.5rem 1rem;
  }
}

/* ========================================
   SMALL MOBILE (≤576px)
   ======================================== */
@media (max-width: 576px) {
  #appContainer {
    border-radius: 1rem;
    padding: 1.5rem 1rem;
  }

  .logo-img {
    max-height: 80px;
  }

  .user-info-container p,
  .user-info-container .btn-link {
    font-size: 0.8rem;
  }

  #sponsorBtn {
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
    min-height: 48px;
    gap: 0.5rem;
  }

  #sponsorBtn i {
    font-size: 1rem;
  }

  .btn-outline-teal {
    font-size: 0.9rem;
    padding: 0.6rem 1rem;
  }

  .sidebar .list-group-item {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* ========================================
   LARGE SCREENS (≥1400px)
   ======================================== */
@media (min-width: 1400px) {
  #appContainer {
    max-width: 1600px;
  }

  .logo-img {
    max-height: 140px;
  }
}