/* Global Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: Arial, sans-serif;
}

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: #fff;
}

/* Top Nav */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #fff;
  border-bottom: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.menu-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-btn svg {
  width: 24px;
  height: 24px;
  fill: #000;
}

/* Logo styles */
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-img {
  height: 60px;   /* same as YouTube’s */
  width: auto;
}

.search {
  flex: 1;
  max-width: 600px;
  margin: 0 40px;
  display: flex;
  align-items: center;
  height: 40px;
  /* make search bar height consistent */
}

.search input {
  flex: 1;
  padding: 0 12px;
  /* remove vertical padding */
  border: 1px solid #ccc;
  border-right: none;
  border-radius: 40px 0 0 40px;
  font-size: 16px;
  outline: none;
  background: #fff;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
  height: 100%;
  /* match container height */
}

.search button {
  width: 64px;
  border: 1px solid #ccc;
  border-radius: 0 40px 40px 0;
  background: #f8f8f8;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  /* match input height */
}

.search button:hover {
  background: #f0f0f0;
}

.search button svg {
  width: 20px;
  /* smaller than before */
  height: 20px;
  fill: #606060;
}

.user-actions {
  display: flex;
  gap: 20px;
  align-items: center;
}

.user-actions svg {
  width: 24px;
  height: 24px;
  fill: #606060;
  cursor: pointer;
}

.profile {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  cursor: pointer;
}

/* Responsive Search Bar for Mobile */
@media (max-width: 480px) {
  .search {
    flex: none;
    width: auto;
    margin: 0 10px;
    position: relative;
  }
  .search input {
    display: none;
    position: absolute;
    top: 40px; /* Below topbar */
    left: 0;
    width: 200px;
    max-width: 80vw;
    background: #fff;
    border-radius: 40px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: display 0.3s, opacity 0.3s;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
  }
  .search input.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }
  .search button {
    width: 40px;
    min-width: 40px;
    border-radius: 50%;
    border: 1px solid #ccc;
    border-left: none;
    background: #f8f8f8;
  }
}

/* Sidebar - compact style */
.sidebar {
  position: fixed;
  top: 56px;
  left: 0;
  bottom: 0;
  width: 72px;
  /* compact width */
  background: #fff;
  border-right: 1px solid #ddd;
  overflow-y: auto;
  transition: transform 0.3s ease;
  z-index: 999;
  padding-top: 10px;
}

.sidebar a {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 0;
  text-decoration: none;
  color: #333;
  font-size: 11px;
}

.sidebar a .icon {
  font-size: 20px;
  margin-bottom: 6px;
  color: #606060;
}


/* Expandable drawer (big nav) */
/* Drawer */
.drawer {
  position: fixed;
  top: 56px;
  /* below topbar */
  left: 0;
  bottom: 0;
  width: 240px;
  background: #fff;
  border-right: 1px solid #ddd;
  transform: translateX(-100%);
  transition: transform 0.3s ease-in-out;
  z-index: 2000;
  overflow-y: auto;
  padding-top: 10px;
}

.drawer.active {
  transform: translateX(0);
}

.drawer a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

.drawer a:hover {
  background: #f2f2f2;
}

/* Content shifts when drawer is open */
.content {
  margin-top: 10px;
  /* only accounts for topbar */
}

.content.shifted {
  margin-left: 240px;
  /* match drawer width */
}

/* Hide overlay if we are pushing instead */
.overlay {
  display: none;
}


/* Mobile responsive */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }
  
  .content {
    margin-left: 0;
  }
  .search {
    max-width: 100%;
    margin: 0 10px;
  }
}

/* 🎤 Voice Search Button (outside search bar) */
.voice-btn {
  background: #f8f8f8;
  border: 1px solid #ccc;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
}

.voice-btn:hover {
  background: #eee;
}

/* 🎤 Voice Search Button */
.search #voiceBtn {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-left: none;
  background: #f8f8f8;
  cursor: pointer;
  border-radius: 0 2px 2px 0;
  font-size: 16px;
}

/* ➕ Create Dropdown */
.create-dropdown {
  position: relative;
}

#createBtn {
  width: 28px;
  height: 28px;
  cursor: pointer;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: 36px;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
  flex-direction: column;
  min-width: 160px;
  z-index: 2000;
}

.dropdown-menu a {
  padding: 10px 14px;
  text-decoration: none;
  color: #000;
  font-size: 14px;
  display: block;
}

.dropdown-menu a:hover {
  background: #f2f2f2;
}


/* Shorts container should fill the whole screen below the top bar */
.shorts-container {
  height: calc(100vh - 56px);   /* 56px = topbar height */
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  background: #fff;
  padding-top: 56px;            /* keeps first card clear of topbar */
}



.shorts-slider {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Remove manual transforms/transition for slider */
}

.shorts-card {
  background: #000;
  width: 360px;
  height: 640px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px; /* space between cards */
  scroll-snap-align: start; /* snap behaviour */
}

.video {
  width: 100%;
  height: 85%;
  object-fit: cover;
}

/* ────────────── Video Details ────────────── */
.video-details {
  width: 100%;
  padding: 8px;
  background: #fff;
  color: #000;
  font-size: 14px;
}

.video-details .channel {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.video-details .channel img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
}

.video-details .channel span {
  font-weight: bold;
}

.video-details .desc {
  margin-top: 5px;
  font-size: 13px;
  color: #333;
}

.video-details .hashtags {
  margin-top: 5px;
  font-size: 12px;
  color: #065fd4;
  cursor: pointer;
}

.video-details .more-btn {
  color: #555;
  font-size: 12px;
  cursor: pointer;
  margin-top: 4px;
}

/* ────────────── Action Buttons ────────────── */
.actions {
  position: absolute;
  right: 10px !important; /* bring buttons visible inside container */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  z-index: 10;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.2s;
}

.action-btn:hover {
  transform: scale(1.1);
  color: #ff0000;
}

.action-btn svg {
  width: 28px;
  height: 28px;
  fill: #333;
  transition: fill 0.2s;
}

.action-btn:hover svg {
  fill: #ff0000;
}

.use-sound svg {
  animation: spin 5s linear infinite;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}

/* ────────────── Navigation Arrows ────────────── */
.nav-arrows {
  position: absolute;
  right: 80px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 20px;
  z-index: 10;
}

.nav-arrow {
  background: #f2f2f2;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.nav-arrow svg {
  width: 20px;
  height: 20px;
  fill: #333;
}

/* ────────────── Comments Panel ────────────── */
.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: flex-end;
  justify-content: center;
  z-index: 100;
}

.comments-panel {
  background: #fff;
  width: 100%;
  max-width: 500px;
  height: 70%;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.comments-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid #ddd;
}

.comments-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
}

.comment {
  display: flex;
  align-items: flex-start;
  margin-bottom: 10px;
}

.comment img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-right: 8px;
}

.comment-content {
  flex: 1;
}

.comment-user {
  font-weight: bold;
  font-size: 13px;
}

.comment-text {
  font-size: 13px;
  margin: 3px 0;
}

.comment-emojis span {
  font-size: 14px;
  margin-right: 6px;
  cursor: pointer;
}

.comment-input {
  display: flex;
  border-top: 1px solid #ddd;
}

.comment-input input {
  flex: 1;
  padding: 8px;
  border: none;
  outline: none;
}

.comment-input button {
  padding: 8px 12px;
  border: none;
  background: #065fd4;
  color: #fff;
  cursor: pointer;
}

/* ────────────── Responsive ────────────── */
@media (max-width: 900px) {
  .sidebar {
    display: none;
  }
  .actions,
  .nav-arrows {
    right: -50px;
  }
}

@media (max-width: 600px) {
.shorts-card {
  width: 100%;
  max-width: 420px;
  height: calc(100vh - 56px);
  margin-bottom: 0;
}
.video {
  height: 100%;
}
  
  .actions,
  .nav-arrows {
    right: -40px;
  }
}



/* Top Switch Styling */
.shorts-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 40px auto;
  gap: 15px;
  font-family: Arial, sans-serif;
}

.shorts-switch .tab {
  padding: 8px 16px;
  cursor: pointer;
  border-radius: 20px;
  font-weight: bold;
  color: #555;
  background: #f1f1f1;
  transition: all 0.3s;
}

.shorts-switch .tab.active {
  background: #000;
  color: #fff;
}

/* Toggle Switch */
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 24px;
}

.toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 24px;
}

.toggle .slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

.toggle input:checked + .slider {
  background-color: #000;
}

.toggle input:checked + .slider:before {
  transform: translateX(22px);
}

/* ===== Mobile Bottom Nav ===== */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: #fff;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  z-index: 1001;
  padding: 0 4px;
}

/* give page content room so nav doesn't cover it */
body {
  padding-bottom: 60px;  /* match nav height */
}

.mobile-bottom-nav .nav-item {
  flex: 1;
  text-align: center;
  color: #333;
  font-size: 13px;
  text-decoration: none;
}

.mobile-bottom-nav .icon {
  font-size: 24px;
}

.mobile-bottom-nav .center-btn .icon {
  background: red;
  color: #fff;
  border-radius: 50%;
  padding: 8px;
  font-size: 28px;
  margin-top: -16px;
}
