/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Roboto', 'Arial', sans-serif;
  background-color: #0f0f0f;
  color: #fff;
  overflow-x: hidden;
}

/* Main Layout */
.main-container {
  display: flex;
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

/* ===== TOP BAR (YouTube Header) ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0f0f0f;
  padding: 0 16px;
  height: 56px;
  border-bottom: 1px solid #272727;
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.hamburger {
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  display: flex;
  align-items: center;
}

.hamburger:hover {
  background: #272727;
}

.yt-logo {
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  position: relative;
}

.yt-logo svg {
  height: 20px;
}

.yt-logo-text {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -1px;
}

.yt-logo sup {
  color: #aaa;
  font-size: 10px;
  font-weight: 400;
  position: absolute;
  top: -2px;
  right: -14px;
}

.search-container {
  display: flex;
  align-items: center;
  flex: 0 1 640px;
}

.search-box {
  display: flex;
  flex: 1;
}

.search-box input {
  width: 100%;
  height: 40px;
  background: #121212;
  border: 1px solid #303030;
  border-right: none;
  border-radius: 20px 0 0 20px;
  color: #fff;
  padding: 0 16px;
  font-size: 16px;
  outline: none;
}

.search-box input:focus {
  border-color: #1c62b9;
}

.search-box input::placeholder {
  color: #888;
}

.search-btn {
  height: 40px;
  width: 64px;
  background: #222;
  border: 1px solid #303030;
  border-radius: 0 20px 20px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-btn svg {
  fill: #fff;
}

.voice-btn {
  width: 40px;
  height: 40px;
  background: #272727;
  border: none;
  border-radius: 50%;
  margin-left: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.voice-btn svg {
  fill: #fff;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-bar-right .icon-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.top-bar-right .icon-btn:hover {
  background: #272727;
}

.top-bar-right .icon-btn svg {
  fill: #fff;
}

.create-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.create-btn:hover {
  background: #272727;
}

.notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #c00;
  color: #fff;
  font-size: 10px;
  font-weight: 500;
  border-radius: 8px;
  padding: 1px 5px;
  min-width: 16px;
  text-align: center;
}

.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  cursor: pointer;
  border: none;
  background: #5c3d99;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

/* ===== LEFT SECTION (Video) ===== */
.left-section {
  flex: 1;
  min-width: 0;
}

/* Video Player */
.video-player-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  aspect-ratio: 16/9;
  overflow: hidden;
}

.video-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #000;
  color: #aaa;
  font-size: 16px;
  gap: 12px;
}

.video-placeholder .embed-instruction {
  background: #222;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  color: #ccc;
  text-align: center;
  max-width: 400px;
}

.video-placeholder iframe {
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  border: none;
}

/* Video Controls Overlay */
.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 0;
  z-index: 10;
}

.progress-bar-container {
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  position: relative;
}

.progress-bar-container:hover {
  height: 5px;
}

.progress-bar {
  height: 100%;
  background: #f00;
  width: 20%;
  position: relative;
  transition: width 0.1s;
}

.progress-bar::after {
  content: '';
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px;
  height: 12px;
  background: #f00;
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.15s;
}

.progress-bar-container:hover .progress-bar::after {
  opacity: 1;
}

.progress-buffer {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  background: rgba(255,255,255,0.3);
  width: 35%;
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
}

.controls-left {
  display: flex;
  align-items: center;
  gap: 4px;
}

.controls-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ctrl-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
}

.ctrl-btn:hover {
  background: rgba(255,255,255,0.1);
}

.ctrl-btn svg {
  fill: #fff;
  width: 24px;
  height: 24px;
}

.time-display {
  color: #ddd;
  font-size: 13px;
  margin-left: 8px;
  font-variant-numeric: tabular-nums;
}

/* Live Badge */
.live-badge-container {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 12px;
}

.live-dot {
  width: 8px;
  height: 8px;
  background: #f00;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* Sponsored overlay */
.sponsored-overlay {
  position: absolute;
  bottom: 60px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(0,0,0,0.85);
  border-radius: 12px;
  padding: 8px 12px;
  z-index: 9;
}

.sponsored-overlay-icon {
  width: 36px;
  height: 36px;
  background: #f90;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.sponsored-overlay-text {
  display: flex;
  flex-direction: column;
}

.sponsored-overlay-text span:first-child {
  font-size: 13px;
  font-weight: 500;
  color: #fff;
}

.sponsored-overlay-text span:last-child {
  font-size: 11px;
  color: #aaa;
}

.sponsored-overlay-btn {
  background: #fff;
  color: #000;
  border: none;
  border-radius: 18px;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  margin-left: 8px;
}

.sponsored-overlay-btn:hover {
  background: #e0e0e0;
}

/* Skip ad */
.skip-ad-btn {
  position: absolute;
  bottom: 60px;
  right: 16px;
  background: rgba(0,0,0,0.8);
  border: 1px solid #555;
  color: #fff;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 9;
}

.skip-ad-btn:hover {
  background: rgba(50,50,50,0.9);
}

/* Sponsored bar (yellow) */
.sponsored-bar {
  background: #e5a00d;
  padding: 2px 8px;
  font-size: 11px;
  color: #000;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sponsored-bar a {
  color: #000;
  text-decoration: none;
}

/* ===== VIDEO INFO ===== */
.video-info {
  padding: 12px 16px 0;
}

.video-title {
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  line-height: 1.4;
}

.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.channel-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.channel-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: #c00;
  display: flex;
  align-items: center;
  justify-content: center;
}

.channel-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.channel-avatar-text {
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
}

.channel-meta {
  display: flex;
  flex-direction: column;
}

.channel-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.verified-badge {
  display: inline-flex;
  align-items: center;
}

.verified-badge svg {
  width: 14px;
  height: 14px;
  fill: #aaa;
}

.channel-subs {
  font-size: 12px;
  color: #aaa;
}

.channel-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-participe {
  background: #272727;
  color: #fff;
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-participe:hover {
  background: #3a3a3a;
}

.btn-subscribe {
  background: #fff;
  color: #0f0f0f;
  border: none;
  border-radius: 18px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
}

.btn-subscribe:hover {
  background: #d9d9d9;
}

/* Action Buttons */
.action-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #272727;
  border: none;
  color: #fff;
  border-radius: 18px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}

.action-btn:hover {
  background: #3a3a3a;
}

.action-btn svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

.like-btn {
  border-right: 1px solid #505050;
  border-radius: 18px 0 0 18px;
  padding-right: 14px;
}

.dislike-btn {
  border-radius: 0 18px 18px 0;
  padding-left: 10px;
}

.action-separator {
  width: 1px;
  height: 24px;
  background: #505050;
}

.more-btn {
  width: 36px;
  height: 36px;
  background: #272727;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.more-btn:hover {
  background: #3a3a3a;
}

.more-btn svg {
  fill: #fff;
  width: 20px;
  height: 20px;
}

/* ===== RIGHT SECTION (Chat) ===== */
.right-section {
  width: 400px;
  min-width: 300px;
  display: flex;
  flex-direction: column;
  border-left: 1px solid #272727;
  background: #0f0f0f;
}

/* Sponsored ad above chat */
.chat-ad {
  border: 1px solid #3a3a3a;
  border-bottom: none;
  padding: 12px;
  background: #1a1a1a;
}

.chat-ad-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.chat-ad-icon {
  width: 36px;
  height: 36px;
  background: #f90;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.chat-ad-meta {
  flex: 1;
}

.chat-ad-meta .ad-title {
  font-size: 13px;
  color: #fff;
}

.chat-ad-meta .ad-label {
  font-size: 11px;
  color: #aaa;
}

.chat-ad-dots {
  cursor: pointer;
  color: #aaa;
  font-size: 18px;
}

.chat-ad-expand {
  cursor: pointer;
  color: #aaa;
  font-size: 18px;
}

.chat-ad-body {
  background: #272727;
  border-radius: 8px;
  padding: 16px;
  margin-top: 8px;
}

.chat-ad-body-title {
  font-size: 15px;
  font-weight: 600;
  color: #f90;
  margin-bottom: 4px;
}

.chat-ad-body-text {
  font-size: 13px;
  color: #ccc;
  margin-bottom: 12px;
}

.chat-ad-body-btn {
  display: block;
  width: 100%;
  background: #fff;
  color: #000;
  border: none;
  border-radius: 18px;
  padding: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
}

.chat-ad-body-btn:hover {
  background: #e0e0e0;
}

/* Chat Container */
.chat-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  border: 1px solid #3a3a3a;
  overflow: hidden;
}

.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  border-bottom: 1px solid #272727;
  min-height: 48px;
}

.chat-header-left {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.chat-header-title {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.chat-header-left svg {
  fill: #fff;
  width: 20px;
  height: 20px;
}

.chat-header-right {
  display: flex;
  align-items: center;
  gap: 4px;
}

.chat-header-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.chat-header-btn:hover {
  background: #272727;
}

.chat-header-btn svg {
  fill: #fff;
  width: 20px;
  height: 20px;
}

/* Chat Messages */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 8px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-messages::-webkit-scrollbar {
  width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: #555;
  border-radius: 4px;
}

.chat-msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 4px 0;
}

.chat-msg:hover {
  background: #1a1a1a;
  border-radius: 4px;
}

.chat-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.chat-msg-content {
  flex: 1;
  min-width: 0;
}

.chat-msg-content .username {
  font-size: 12px;
  font-weight: 500;
  color: #aaa;
  margin-right: 6px;
}

.chat-msg-content .msg-text {
  font-size: 13px;
  color: #e8e8e8;
  word-wrap: break-word;
  line-height: 1.4;
}

.chat-msg-content .msg-text .emoji {
  font-size: 16px;
}

/* Chat Input */
.chat-input-area {
  border-top: 1px solid #272727;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-input-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #5c3d99;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}

.chat-input {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 1px solid #555;
  color: #fff;
  padding: 6px 0;
  font-size: 13px;
  outline: none;
}

.chat-input::placeholder {
  color: #777;
}

.chat-input:focus {
  border-bottom-color: #fff;
}

.chat-emoji-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.chat-emoji-btn:hover {
  background: #272727;
}

.chat-emoji-btn svg {
  fill: #aaa;
  width: 20px;
  height: 20px;
}

.chat-send-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  opacity: 0.5;
}

.chat-send-btn:hover {
  background: #272727;
}

.chat-send-btn svg {
  fill: #fff;
  width: 20px;
  height: 20px;
}

/* ===== LOGIN OVERLAY ===== */
.login-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-modal {
  background: #1a1a1a;
  border: 1px solid #3a3a3a;
  border-radius: 12px;
  padding: 40px;
  max-width: 420px;
  width: 90%;
  text-align: center;
}

.login-modal h2 {
  font-size: 22px;
  margin-bottom: 8px;
  color: #fff;
  font-weight: 600;
}

.login-modal p {
  font-size: 14px;
  color: #aaa;
  margin-bottom: 24px;
}

.login-modal input[type="text"] {
  width: 100%;
  padding: 12px 16px;
  background: #0f0f0f;
  border: 1px solid #3a3a3a;
  border-radius: 8px;
  color: #fff;
  font-size: 16px;
  outline: none;
  margin-bottom: 16px;
  font-family: 'Roboto', sans-serif;
}

.login-modal input[type="text"]:focus {
  border-color: #1c62b9;
}

.login-modal input[type="text"]::placeholder {
  color: #666;
}

.login-modal button[type="submit"] {
  width: 100%;
  padding: 12px;
  background: #c00;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  font-family: 'Roboto', sans-serif;
  transition: background 0.2s;
}

.login-modal button[type="submit"]:hover {
  background: #a00;
}

.login-modal button[type="submit"]:disabled {
  background: #555;
  cursor: not-allowed;
}

.login-error {
  color: #f44;
  font-size: 13px;
  margin-top: 12px;
  min-height: 18px;
}

/* ===== VOTING WIDGET ===== */
.voting-widget {
  border: 1px solid #3a3a3a;
  border-bottom: none;
  padding: 16px;
  background: #1a1a1a;
}

.voting-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.voting-icon {
  font-size: 20px;
}

.voting-question {
  font-size: 14px;
  font-weight: 500;
  color: #fff;
}

.voting-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.voting-option-btn {
  flex: 1;
  min-width: 80px;
  padding: 10px 16px;
  background: #272727;
  border: 1px solid #3a3a3a;
  border-radius: 18px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  font-family: 'Roboto', sans-serif;
}

.voting-option-btn:hover:not(:disabled) {
  background: #3a3a3a;
  border-color: #555;
}

.voting-option-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.voting-option-btn.voted {
  background: #1c62b9;
  border-color: #1c62b9;
  color: #fff;
}

.voting-results {
  margin-top: 8px;
}

.voting-result-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.voting-result-label {
  font-size: 12px;
  color: #ccc;
  min-width: 60px;
}

.voting-result-bar-bg {
  flex: 1;
  height: 6px;
  background: #272727;
  border-radius: 3px;
  overflow: hidden;
}

.voting-result-bar {
  height: 100%;
  background: #1c62b9;
  border-radius: 3px;
  transition: width 0.5s ease;
}

.voting-result-pct {
  font-size: 12px;
  color: #aaa;
  min-width: 65px;
  text-align: right;
}

.voting-status {
  font-size: 12px;
  color: #4ac884;
  margin-top: 4px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1000px) {
  .main-container {
    flex-direction: column;
  }

  .right-section {
    width: 100%;
    min-width: unset;
    border-left: none;
    border-top: 1px solid #272727;
    height: 400px;
  }
}

@media (max-width: 650px) {
  .search-container {
    display: none;
  }

  .channel-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .action-buttons {
    width: 100%;
    overflow-x: auto;
  }
}
