/* Reset global */
* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: #0f0f0f;
  color: #fff;
  font-size: 100%;
}

a {
  color: rgb(96, 15, 15);
  text-decoration: none;
}

/* ---------- Top bar ---------- */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: #212121;
  border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.08);
  z-index: 1000;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.menu-btn {
  border: none;
  background: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  color: #fff;
}

.logo-icon {
  max-width: 2.1875rem;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.topbar-search {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  max-width: 37.5rem;
  gap: 0.5rem;
  margin: 0 1.25rem;
}

.search-form {
  display: flex;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.search-input {
  flex: 1;
  padding: 0.5rem 1rem;
  border: none;
  font-size: 0.875rem;
  background: transparent;
  color: #fff;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.search-input:focus {
  outline: none;
}

.search-btn {
  width: 56px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
}

.search-btn:hover {
  color: #fff;
}

.mic-btn {
  background: transparent;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  color: rgba(255, 255, 255, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
}

.mic-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.topbar-right {
  display: flex;
  gap: 8px;
}

.btn {
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 16px;
  color: rgba(255, 255, 255, 0.7);
  display: flex;
  align-items: center;
}

.btn:hover {
  color: #fff;
}

.avatar-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #f00;
  cursor: pointer;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}

.avatar-btn:hover {
  background: #cc0000;
}

/* ---------- Layout ---------- */
.app-layout {
  display: flex;
  margin-top: 3.5rem;
  margin-left: 15rem;
  transition: margin-left 0.3s ease;
}

.sidebar-collapsed .app-layout {
  margin-left: 4rem;
}

.sidebar {
  width: 15rem;
  padding: 0.75rem 0;
  background: #000000;
  border-right: 0.0625rem solid rgb(249, 245, 245);
  position: fixed;
  left: 0;
  top: 3.5rem;
  z-index: 950;
  overflow-y: auto;
  transition: width 0.3s ease;
  height: calc(100vh - -12rem);
}

.sidebar-collapsed .sidebar {
  width: 4rem;
  overflow: hidden;
}

.sidebar-collapsed .sidebar-section h2,
.sidebar-collapsed .sidebar-item span:not(.icon) {
  display: none;
}

.sidebar-collapsed .sidebar-item {
  justify-content: center;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 12px;
}

.sidebar-section h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgb(252, 252, 252);
  padding: 0 16px;
  margin-bottom: 8px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  margin: 0 0.75rem;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: background 0.2s;
  font-size: 0.875rem;
  color: rgb(255, 255, 255);
}

.sidebar-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.sidebar-item .icon {
  font-size: 24px;
  min-width: 24px;
}

/* ---------- Chips ---------- */
.chips-container {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.1);
}

.chips-container::-webkit-scrollbar {
  height: 4px;
}

.chips-container::-webkit-scrollbar-track {
  background: transparent;
}

.chips-container::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: 0.0625rem solid rgba(255, 255, 255, 0.3);
  background: transparent;
  border-radius: 1.25rem;
  color: #fff;
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.chip.active {
  background: #fff;
  color: #030303;
  border-color: #fff;
}

.chip.active:hover {
  background: rgba(255, 255, 255, 0.9);
}

/* ---------- Videos ---------- */
.videos {
  flex: 1;
  padding: 1rem;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1rem;
}

.video-card {
  background: transparent;
  border-radius: 0.75rem;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}

.video-card:hover {
  transform: translateY(-0.25rem);
}

.video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #333;
  border-radius: 0.75rem;
}

.video-info {
  padding: 12px 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.channel-avatar {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.video-meta {
  flex: 1;
}

.video-title {
  font-size: 0.875rem;
  margin: 0 0 8px;
  line-height: 1.3;
  color: #fff;
  font-weight: 500;
}

.video-channel {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* ---------- Backdrop ---------- */
.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 900;
  display: none;
}

.sidebar-open .backdrop {
  display: block;
}

/* ---------- Responsive ---------- */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* Tablets/Mobile (hasta 768px) */
@media (max-width: 768px) {
  .app-layout {
    margin-left: 0;
  }

  .sidebar {
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .topbar {
    padding: 0 12px;
  }

  .topbar-search {
    max-width: 300px;
    margin: 0 8px;
  }

  .search-form {
    max-width: 100%;
  }

  .search-btn {
    width: 40px;
  }

  .btn {
    font-size: 13px;
    padding: 6px 12px;
  }

  .avatar-btn {
    width: 28px;
    height: 28px;
    font-size: 12px;
  }

  .topbar-right {
    gap: 8px;
  }

  .videos {
    padding: 12px 8px;
    overflow-y: auto;
  }

  .chips-container {
    padding: 8px 8px;
    margin-bottom: 12px;
    gap: 8px;
  }

  .video-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .video-info {
    padding: 8px 0;
  }

  .channel-avatar {
    width: 36px;
    height: 36px;
  }

  .video-title {
    font-size: 13px;
  }

  .video-channel {
    font-size: 11px;
  }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
  .topbar {
    padding: 0 8px;
    height: 48px;
  }

  .menu-btn {
    font-size: 20px;
    padding: 6px;
  }

  .logo-icon {
    font-size: 24px;
  }

  .logo {
    font-size: 16px;
    gap: 4px;
  }

  .topbar-left {
    gap: 8px;
  }

  .topbar-search {
    max-width: 200px;
    margin: 0 4px;
  }

  .search-form {
    border-radius: 20px;
  }

  .search-input {
    padding: 6px 12px;
    font-size: 13px;
  }

  .search-btn {
    width: 36px;
    font-size: 16px;
  }

  .mic-btn {
    width: 32px;
    height: 32px;
  }

  .btn {
    font-size: 11px;
    padding: 4px 8px;
  }

  .avatar-btn {
    width: 24px;
    height: 24px;
    font-size: 9px;
  }

  .topbar-right {
    gap: 8px;
  }

  /* Sidebar */
  .app-layout {
    margin-top: 48px;
  }

  .sidebar {
    top: 48px;
    width: 200px;
  }

  .sidebar-section {
    margin-bottom: 8px;
  }

  .sidebar-item {
    font-size: 13px;
    gap: 8px;
    padding: 6px 8px;
    margin: 0 8px;
  }

  .sidebar-item .icon {
    font-size: 20px;
  }

  /* Chips */
  .videos {
    padding: 8px 6px;
  }

  .chips-container {
    padding: 6px 6px;
    margin-bottom: 8px;
    gap: 6px;
  }

  .chip {
    padding: 6px 12px;
    font-size: 12px;
  }

  /* Videos */
  .video-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .video-thumb {
    border-radius: 8px;
  }

  .video-info {
    padding: 6px 0;
  }

  .channel-avatar {
    width: 32px;
    height: 32px;
  }

  .video-title {
    font-size: 12px;
    margin: 0 0 4px;
  }

  .video-channel {
    font-size: 10px;
  }
}


  .video-channel {
    font-size: 10px;
  }
}

