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

body {
  font-family: Arial, sans-serif;
  background: white;
  color: #333;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 200;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #fff;
  border-bottom: 1px solid #fff;
}

.topbar .logo {
  height: 25px;
  margin-left: -50px; /* Move logo further right */
}

.topbar .search {
  flex: 1;
  max-width: 600px;
  margin: 0 20px;
  display: flex;
}

.topbar .search input {
  flex: 1;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 20px 0 0 20px;
  outline: none;
}

.topbar .search button {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-left: none;
  border-radius: 0 20px 20px 0;
  background: #eee;
  cursor: pointer;
}

.topbar .actions {
  display: flex;
  gap: 40px; /* Increased gap between notification and profile */
  align-items: center;
  margin-right: 60px;
}

.topbar .actions img[alt="Profile"] {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
}

.topbar .actions button {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
}

.mic-btn {
  background: none;
  border: none;
  margin-left: 12px;
  margin-right: 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
}

/* Sidebar */
.sidebar {
  position: fixed;
  top: 56px; /* Height of topbar (adjust if needed) */
  left: 0;
  height: calc(100vh - 56px); /* Fill below topbar */
  width: 72px;
  padding: 1.5rem 0.25rem 1rem 0.25rem;
  border-right: 1px solid #fff;
  background: #fff;
  z-index: 101;
  display: none;
}

.sidebar nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-start;
  gap: 2.5rem; /* Increased gap for more spacing */
  margin-top: 2rem; /* Push links lower */
}

.sidebar nav a {
  text-decoration: none;
  color: #333;
  font-size: 0.67rem;
  padding: 0.1rem 0;
  border-radius: 4px;
  width: 100%;
  text-align: center;
  transition: background 0.2s;
}

.sidebar nav a:hover {
  background: #f5f5f5;
}

/* Layout */
.layout {
  display: flex;
}

/* Main Content */
.content {
  flex: 1;
  padding: 1rem;
  margin-left: 60px; /* Ensure content starts after sidebar */
  margin-top: 56px; /* Push content below topbar */
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
  .content {
    margin-left: 60px;
    margin-top: 56px; /* Push content below topbar */
  }
}

/* Shorts Section */
.shorts {
  margin-bottom: 2rem;
  margin-left: 20px;
}

.shorts-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.shorts-header h2 {
  font-size: 1.1rem;
}

.shorts-header a {
  font-size: 0.9rem;
  color: #065fd4;
  text-decoration: none;
}

.shorts-grid {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.short-card {
  position: relative;
  min-width: 120px;
  max-width: 160px;
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  display: flex;
  align-items: flex-end;
  padding: 0;
  background: #000;
}

.short-card img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  z-index: 1;
}

.short-card-text {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  padding: 0.6rem 0.5rem;
  background: linear-gradient(to top, rgba(0,0,0,0.7) 70%, rgba(0,0,0,0.2) 100%);
  color: #fff;
  border-radius: 0 0 8px 8px;
  text-align: center; /* Center the text horizontally */
  z-index: 2;
}

.short-card-text h3 {
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
  font-weight: 500;
}

.short-card-text p {
  font-size: 0.75rem;
  margin: 0;
}

/* Video Grid */
.videos {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-left: 20px;
}

.video-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  max-width: 370px;
}

.video-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.video-info {
  display: flex;
  padding: 0.5rem;
  gap: 0.5rem;
  align-items: flex-start;
}

.video-info img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
}

.video-text {
  flex: 1;
}

.video-text h3 {
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
  font-weight: 500;
}

.video-text p {
  font-size: 0.8rem;
  color: #555;
}

/* Bottom Navigation (mobile only) */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #ddd;
  z-index: 100;
  justify-content: center;
  padding: 0.5rem 0;
}

.bottom-nav nav {
  display: flex;
  gap: 2rem;
}

.bottom-nav a {
  text-decoration: none;
  color: #333;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background 0.2s;
}

.bottom-nav a:hover {
  background: #f5f5f5;
}

/* Suggestions Strip */
.suggestions-strip {
  display: flex;
  gap: 0.75rem;
  overflow-x: auto;
  padding: 0.75rem 0 1rem 20px;
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
  background: #fff;
}

.suggestions-strip button {
  background: #f1f1f1;
  border: none;
  border-radius: 18px;
  padding: 0.5rem 1.2rem;
  font-size: 0.95rem;
  color: #333;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s;
}

.suggestions-strip button:hover,
.suggestions-strip button:focus {
  background: #e5e5e5;
}

/* Make short and video cards clickable */
.short-card, .video-card {
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, transform 0.2s;
  display: block;
}

/* Video card zoom effect on hover */
.video-card:hover {
  transform: scale(1.04);
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  z-index: 2;
}

@media (min-width: 768px) {
  .videos {
    grid-template-columns: repeat(2, 1fr);
  }
  .shorts-grid {
    gap: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .sidebar {
    display: block;
  }
  .videos {
    grid-template-columns: repeat(3, 1fr);
  }
  .shorts-grid {
    overflow-x: visible;
    flex-wrap: wrap;
    gap: 2rem;
  }
  .bottom-nav {
    display: none;
  }
}
