/* ============================
   STREAM PAGE STYLES
   Armando Flores Cakery Studio
   ============================ */

/* ── PAGE BASE ── */
body.stream-page {
  background: var(--dark);
  min-height: 100vh;
}

/* ── STREAM HEADER ── */
.stream-header {
  padding: 5.5rem 2rem 1.5rem;
  background: linear-gradient(180deg, rgba(13,13,13,0.98) 0%, rgba(13,13,13,0.7) 100%);
  border-bottom: 1px solid rgba(201,168,76,0.12);
  position: relative;
  z-index: 1;
}
.stream-header-inner {
  max-width: 1400px;
  margin: 0 auto;
}
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #e53935;
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 2px;
  padding: 0.25rem 0.7rem;
  border-radius: 4px;
  margin-bottom: 0.6rem;
}
.live-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #fff;
  animation: blink-live 1s ease-in-out infinite;
}
@keyframes blink-live { 0%,100%{opacity:1} 50%{opacity:0.3} }

.stream-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--cream);
  margin: 0 0 0.4rem;
  line-height: 1.3;
}
.stream-desc {
  color: var(--gray);
  font-size: 0.9rem;
  margin: 0 0 0.6rem;
  max-width: 700px;
}
.stream-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.viewer-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  color: var(--gray-light);
  font-size: 0.78rem;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
}
.stream-cat-badge {
  background: rgba(201,168,76,0.15);
  border: 1px solid rgba(201,168,76,0.3);
  color: var(--gold);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  padding: 0.25rem 0.7rem;
  border-radius: 20px;
  display: none;
}

/* ── LAYOUT ── */
.stream-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  gap: 1.5rem;
  position: relative;
  z-index: 1;
}

@media (max-width: 1024px) {
  .stream-layout {
    grid-template-columns: 1fr;
  }
  .stream-chat-col {
    order: -1;
  }
  .chat-panel {
    max-height: 420px !important;
  }
}

/* ── VIDEO PLAYER ── */
.stream-player-col {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.stream-player-wrap {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.stream-player-wrap iframe,
.stream-player-wrap video {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}
.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--gray);
}
.player-loading p {
  font-size: 0.85rem;
  letter-spacing: 1px;
}

/* ── VIDEO INFO BOX ── */
.stream-info-box {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.stream-info-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.stream-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--red));
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1rem;
  color: var(--dark);
  flex-shrink: 0;
}
.stream-info-left h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--cream);
  margin: 0 0 0.1rem;
}
.stream-info-left p {
  font-size: 0.78rem;
  color: var(--gray);
  margin: 0;
}

/* ── RELATED VIDEOS ── */
.related-section h3 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  color: var(--gold);
  margin: 0 0 1rem;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.9rem;
}
.related-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s;
}
.related-card:hover { transform: translateY(-2px); }
.related-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  background: rgba(255,255,255,0.05);
  border-radius: 8px;
  overflow: hidden;
  position: relative;
}
.related-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.related-thumb-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
  color: var(--gray);
}
.related-duration {
  position: absolute;
  bottom: 5px; right: 6px;
  background: rgba(0,0,0,0.75);
  color: #fff;
  font-size: 0.68rem;
  padding: 1px 5px;
  border-radius: 3px;
}
.related-info {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.related-title {
  font-size: 0.82rem;
  color: var(--cream);
  line-height: 1.4;
  margin: 0;
}
.related-cat {
  font-size: 0.72rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* ── CHAT PANEL ── */
.stream-chat-col {
  display: flex;
  flex-direction: column;
}
.chat-panel {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  height: 600px;
  max-height: 80vh;
  position: sticky;
  top: 80px;
  overflow: hidden;
}
.chat-header {
  padding: 0.9rem 1.1rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.chat-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.5px;
}
.chat-online {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--gray);
}
.online-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #4caf50;
  animation: blink-live 2s ease-in-out infinite;
}

/* ── CHAT JOIN FORM ── */
.chat-join {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  gap: 1rem;
  text-align: center;
}
.chat-join p {
  font-size: 0.88rem;
  color: var(--gray-light);
}
.chat-join-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
  max-width: 240px;
}
.chat-join-form input {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 0.6rem 0.9rem;
  color: var(--cream);
  font-size: 0.88rem;
  transition: border-color 0.2s;
  width: 100%;
}
.chat-join-form input:focus {
  border-color: var(--gold);
}
.chat-join-form input::placeholder { color: var(--gray); }

/* ── MESSAGES ── */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.12) transparent;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.12);
  border-radius: 4px;
}
.chat-msg {
  font-size: 0.84rem;
  line-height: 1.5;
  word-break: break-word;
}
.chat-msg--system {
  color: var(--gray);
  font-style: italic;
  font-size: 0.78rem;
  text-align: center;
  padding: 0.15rem 0;
}
.chat-msg--user {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: baseline;
}
.chat-msg-name {
  font-weight: 700;
  color: var(--gold);
  font-size: 0.82rem;
  flex-shrink: 0;
}
.chat-msg-name--me { color: var(--teal-light); }
.chat-msg-text {
  color: var(--cream);
}

/* ── CHAT INPUT ── */
.chat-input-area {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 0.75rem 1rem;
  flex-shrink: 0;
}
.chat-input-row {
  display: flex;
  gap: 0.5rem;
}
.chat-input-row input {
  flex: 1;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.13);
  border-radius: 8px;
  padding: 0.55rem 0.85rem;
  color: var(--cream);
  font-size: 0.85rem;
  transition: border-color 0.2s;
}
.chat-input-row input:focus { border-color: var(--gold); }
.chat-input-row input::placeholder { color: var(--gray); }
.chat-send-btn {
  background: var(--gold);
  border: none;
  border-radius: 8px;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--dark);
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  flex-shrink: 0;
}
.chat-send-btn:hover {
  background: var(--gold-light);
  transform: scale(1.08);
}
.chat-footer-note {
  font-size: 0.7rem;
  color: var(--gray);
  margin-top: 0.35rem;
  text-align: center;
}

/* ── NO STREAM STATE ── */
.no-stream-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  padding: 3rem 1.5rem;
  position: relative;
  z-index: 1;
}
.no-stream-inner {
  text-align: center;
  max-width: 480px;
}
.no-stream-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.no-stream-inner h2 {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 0.5rem;
}
.no-stream-inner p {
  color: var(--gray);
  margin-bottom: 1.5rem;
}
.no-stream-links {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.no-stream-back {
  color: var(--gray);
  font-size: 0.85rem;
  transition: color 0.2s;
}
.no-stream-back:hover { color: var(--gold); }
