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

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Inter', sans-serif;
  background: #0a0c10;
  color: #eef2ff;
}

.app-container {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  background: radial-gradient(circle at 20% 30%, #11161f, #080b0f);
  position: relative;
  overflow: hidden;
}

/* ========== NOTIFICATION TOASTS ========== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none; /* Let clicks pass through */
}

.toast {
  background: rgba(30, 36, 48, 0.95);
  backdrop-filter: blur(8px);
  border-left: 4px solid #8aa9ff;
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: slideIn 0.3s ease-out forwards;
  pointer-events: auto;
  max-width: 300px;
}

.toast.leave {
  border-left-color: #ff8686;
}

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

/* ========== LANDING PAGE FEATURES ========== */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  width: 100%;
  margin-bottom: 24px;
  text-align: center;
}

.feature-item {
  background: rgba(255,255,255,0.03);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.05);
}

.feature-icon {
  font-size: 1.5rem;
  color: #8aa9ff;
  margin-bottom: 8px;
}

.feature-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #eef2ff;
}

.feature-desc {
  font-size: 0.7rem;
  color: #8e9eae;
  margin-top: 4px;
}

/* ========== HEADER ========== */
.header {
  background: rgba(18, 22, 28, 0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(72, 85, 106, 0.4);
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  z-index: 10;
  flex-shrink: 0;
}

.logo {
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.3px;
  color: #8aa9ff;
  white-space: nowrap;
}

.room-info {
  background: #1e2430;
  padding: 6px 14px;
  border-radius: 40px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid #2e3a48;
  flex-wrap: wrap;
}

.room-id {
  font-family: monospace;
  background: #00000055;
  padding: 4px 10px;
  border-radius: 30px;
  letter-spacing: 0.5px;
}

.copy-link-btn {
  background: #2a3645;
  border: none;
  color: white;
  padding: 6px 12px;
  border-radius: 30px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
  touch-action: manipulation;
  white-space: nowrap;
}

.copy-link-btn:hover { background: #3e4d62; }

.badge {
  padding: 4px 10px;
  border-radius: 30px;
  font-size: 0.7rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.host-badge { background: #b8860b; color: #ffecb3; }
.guest-badge { background: #2a4b6e; color: #b8d8fc; }

.main-layout {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
  min-height: 0;
}

.video-section {
  flex: 3;
  display: flex;
  flex-direction: column;
  padding: 16px 20px 16px 24px;
  overflow-y: auto;
  min-height: 0;
  position: relative;
}

/* VIDEO WRAPPER & OVERLAY */
.video-wrapper {
  background: #00000055;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 20px 35px -12px rgba(0, 0, 0, 0.5);
  aspect-ratio: 16 / 9;
  width: 100%;
  position: relative;
  background: #0f1217;
  flex-shrink: 0;
}

.guest-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 50;
  display: none; 
  cursor: not-allowed;
  background: transparent;
}

#player-container {
  width: 100%;
  height: 100%;
}

.video-controls {
  margin-top: 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  background: #10141cbb;
  backdrop-filter: blur(8px);
  padding: 8px 16px;
  border-radius: 60px;
  width: 100%;
  border: 1px solid #2c3542;
  flex-shrink: 0;
}

.ctrl-btn {
  background: #252e3b;
  border: none;
  color: white;
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
}
.ctrl-btn:active { transform: scale(0.96); }
.ctrl-btn:hover { background: #3f4b5c; }
.ctrl-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.seek-slider {
  flex: 1;
  min-width: 120px;
  height: 5px;
  -webkit-appearance: none;
  background: #2e3b47;
  border-radius: 5px;
  outline: none;
}
.seek-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  background: #8aa9ff;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 5px #8aa9ff;
}

.url-input-group {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  width: 100%;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.url-input {
  flex: 3;
  background: #1a1f29;
  border: 1px solid #2f3a48;
  padding: 10px 16px;
  border-radius: 40px;
  color: white;
  font-size: 0.85rem;
  outline: none;
}
.url-input:focus { border-color: #8aa9ff; }
.load-vid-btn {
  background: #8aa9ff;
  border: none;
  padding: 0 20px;
  border-radius: 40px;
  font-weight: 600;
  cursor: pointer;
  transition: 0.2s;
  color: #0a0c10;
  touch-action: manipulation;
}
.load-vid-btn:hover { background: #a0bbff; }
.load-vid-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.helper-text {
  font-size: 0.7rem;
  color: #8e9eae;
  margin-top: 8px;
  text-align: center;
  flex-shrink: 0;
  margin-bottom: 20px;
}

/* ========== CHAT PANEL ========== */
.chat-panel {
  flex: 1.2;
  background: #0e1219dd;
  backdrop-filter: blur(12px);
  border-left: 1px solid #2a3440;
  display: flex;
  flex-direction: column;
  min-width: 260px;
  height: 100%;
  overflow: hidden;
  position: relative;
  min-height: 0;
}

.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid #242e3a;
  font-weight: 600;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.participants-list {
  font-size: 0.7rem;
  background: #080c12;
  border-radius: 20px;
  padding: 4px 10px;
  color: #b9c7d9;
}

.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 0;
}

.message {
  background: #1b212b;
  padding: 8px 12px;
  border-radius: 18px;
  max-width: 90%;
  word-wrap: break-word;
  font-size: 0.85rem;
  border-left: 3px solid;
}
.message .author { font-weight: 700; font-size: 0.75rem; margin-bottom: 4px; }
.message .text { color: #eef2ff; }

.chat-input-area {
  padding: 12px;
  display: flex;
  gap: 10px;
  background: #0a0e14;
  border-top: 1px solid #242e3a;
  flex-shrink: 0;
  position: relative;
  z-index: 50;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.chat-input {
  flex: 1;
  background: #1b212c;
  border: none;
  padding: 12px 16px;
  border-radius: 40px;
  color: white;
  outline: none;
  font-size: 16px !important;
  min-height: 44px;
}

.send-msg {
  background: #8aa9ff;
  border: none;
  width: 48px;
  min-width: 48px;
  height: 48px;
  border-radius: 40px;
  cursor: pointer;
  color: #0a0c10;
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  margin-bottom: env(safe-area-inset-bottom);
}
.send-msg:hover { background: #a0bbff; }
.send-msg:active { transform: scale(0.96); }

.join-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px;
}
.join-card {
  background: #141a24;
  padding: 28px 24px;
  border-radius: 40px;
  width: 100%;
  max-width: 450px;
  text-align: center;
  border: 1px solid #2f3a4b;
}
.join-card h2 { color: #8aa9ff; margin-bottom: 10px; font-size: 2rem; }
.join-card p.subtitle { color: #8e9eae; margin-bottom: 24px; font-size: 0.95rem; }
.join-card input {
  width: 100%;
  padding: 12px;
  margin-bottom: 16px;
  background: #1e2532;
  border: 1px solid #38455a;
  border-radius: 60px;
  color: white;
  font-size: 1rem;
}
.btn-group {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.primary-btn {
  background: #8aa9ff;
  padding: 10px 20px;
  border-radius: 40px;
  font-weight: bold;
  border: none;
  color: #0a0c10;
  cursor: pointer;
  touch-action: manipulation;
}
.primary-btn:hover { background: #a0bbff; }
.secondary-btn {
  background: #2d3748;
  padding: 10px 20px;
  border-radius: 40px;
  border: none;
  color: white;
  cursor: pointer;
}

/* Name prompt modal */
.name-modal {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
}
.name-modal .modal-card {
  background: #141a24;
  padding: 28px 24px;
  border-radius: 40px;
  width: 90%; max-width: 380px;
  text-align: center;
  border: 1px solid #2f3a4b;
}
.name-modal input {
  width: 100%; padding: 12px; margin: 16px 0;
  background: #1e2532; border: 1px solid #38455a;
  border-radius: 60px; color: white; font-size: 1rem;
}
.name-modal button {
  background: #8aa9ff; padding: 10px 20px; border-radius: 40px;
  font-weight: bold; border: none; color: #0a0c10;
  cursor: pointer; touch-action: manipulation;
}
.name-modal button:hover { background: #a0bbff; }

.disabled-ctrl { opacity: 0.5; pointer-events: none; }

/* ========== FOOTER STYLING ========== */

.app-footer {
  background: rgba(10, 14, 20, 0.8);
  backdrop-filter: blur(8px);
  border-top: 1px solid #2a3440;
  padding: 12px 20px; /* Slightly increased padding */
  text-align: center;
  font-size: 0.8rem;
  color: #a0b0c0; /* Gray text for "Made with care by" and "©" */
  z-index: 10;
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px; /* Small gap between elements */
  flex-wrap: wrap; /* Allows wrapping on very small screens */
}

.join-footer {
  margin-top: 24px;
  text-align: center;
  font-size: 0.85rem;
  color: #a0b0c0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

/* Footer Links - Blue Highlight */
.app-footer a,
.join-footer a {
  color: #8aa9ff; 
  text-decoration: none;
  font-weight: 600; /* Slightly bolder to stand out */
  margin: 0 2px; /* Breathing room around the link */
}

/* Hover Effect */
.app-footer a:hover,
.join-footer a:hover {
  color: #a0bbff;
  text-decoration: underline;
}

/* Optional: Make the copyright symbol slightly smaller/subtler */
.app-footer span, 
.join-footer span {
  opacity: 0.8;
  font-size: 0.9em;
}
/* ========== MOBILE ========== */
@media (max-width: 780px) {
  .app-container { height: 100dvh; }
  .main-layout { flex-direction: column; flex: 1; overflow: hidden; }
  
  .video-section { 
    flex: 1; padding: 10px; width: 100%; 
    overflow-y: auto; min-height: 0; 
  }
  
  .chat-panel { 
    flex: 0 0 300px; height: 300px; min-height: 280px;
    width: 100%; border-left: none; border-top: 1px solid #2a3440;
  }
  
  .chat-input-area { padding: 10px; padding-bottom: calc(10px + env(safe-area-inset-bottom)); }
  .chat-input { font-size: 16px !important; padding: 10px 14px; height: 44px; }
  .send-msg { width: 44px; min-width: 44px; height: 44px; flex-shrink: 0; }

  .header { padding: 8px 12px; gap: 8px; flex-shrink: 0; }
  .logo { font-size: 1.1rem; }
  .room-info { 
    font-size: 0.65rem; padding: 4px 8px; gap: 6px; 
    flex-wrap: nowrap !important; overflow-x: auto; max-width: 100%;
  }
  .room-info span { white-space: nowrap; }
  .room-id { padding: 2px 6px; font-size: 0.7rem; }
  .copy-link-btn { padding: 4px 8px; font-size: 0.6rem; }
  .desktop-only-text { display: none; }
  .badge { font-size: 0.6rem; padding: 2px 6px; }
  
  .video-controls { padding: 6px 12px; gap: 8px; margin-top: 10px; }
  .ctrl-btn { width: 36px; height: 36px; font-size: 1rem; }
  .url-input-group { margin-top: 10px; margin-bottom: 10px; }
  .url-input { font-size: 0.8rem; padding: 8px 12px; }
  .load-vid-btn { padding: 0 16px; font-size: 0.8rem; }
  
  .app-footer { display: block; padding: 8px 12px; font-size: 0.7rem; flex-shrink: 0; }
}
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #0a0c10; 
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: #1e2430; 
  border-radius: 10px;
  border: 1px solid #0a0c10; 
}

::-webkit-scrollbar-thumb:hover {
  background: #8aa9ff; /
}

* {
  scrollbar-width: thin;
  scrollbar-color: #1e2430 #0a0c10;
}