body {
  background-color: #f9f9f9;
  min-height: 100vh;
  position: relative;
  padding-bottom: 60px; /* Footer height for mobile */
  margin: 0;
  overflow-x: hidden;
}

.navbar-brand {
  color: red !important;
  font-weight: bold;
  font-size: 22px;
}

.search-bar {
  width: 100%;
  max-width: 500px;
  display: flex;
  flex-direction: row;
  align-items: stretch;
}

.search-bar input.form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  flex: 1 1 auto;
}

.search-bar button {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  min-width: 50px;
  flex: 0 0 auto;
}

.sidebar {
  min-height: 100vh;
  background-color: white;
  padding-top: 60px;
  box-shadow: 1px 0 2px rgba(0,0,0,0.1);
}

.menu-item {
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.menu-item:hover {
  background-color: #f0f0f0;
}

/* Video Card Grid Fixes */
.video-card {
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
}

.video-card .card-img-top {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  object-position: center;
  min-height: 0;
  background: #ddd;
  display: block;
}

.video-card .card-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 0px;
  padding-bottom: 0px;
}

.video-info {
  display: flex;
  margin-top: 2px; /* Minimal gap between thumbnail and info */
}

.channel-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  margin-right: 10px;
}

.video-title {
  font-weight: 500;
  margin-bottom: 4px;
  font-size: 16px;
  line-height: 1.3;
}

.video-meta {
  font-size: 14px;
  color: #606060;
}

/* Desktop: YouTube-like Card Dimensions & Grid */
@media (min-width: 1200px) {
  .video-card {
    width: 360px; /* YouTube desktop width */
    height: 280px; /* YouTube card height incl. title/info */
  }
  .row-cols-lg-4 > .col {
    display: flex;
  }
  .video-card .card-body {
    padding-top: 6px;
  }
  .video-info {
    margin-top: 2px;
  }
}

/* === Mobile/Android FULL WIDTH VIDEO PLAYER & CARDS === */
@media (max-width: 767.98px) {
  html, body {
    width: 100vw;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .sidebar {
    display: none;
  }
  .search-bar {
    max-width: none;
    width: 100%;
  }
  body {
    padding-bottom: 60px !important;
  }
  .mobile-footer {
    display: flex !important;
  }
  /* Remove all paddings for edge-to-edge */
  .container-fluid,
  .container-fluid > .row,
  .col-12,
  .col-md-10,
  .row,
  .row > .col,
  #video-grid {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  /* Video card full width */
  .video-card {
    min-height: unset;
    max-width: 100vw !important;
    min-width: 0;
    border-radius: 0;
    width: 100vw !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .row-cols-1 > .col,
  .row-cols-sm-2 > .col,
  .row-cols-md-3 > .col,
  .row-cols-lg-4 > .col {
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  /* Remove gap between video cards */
  #video-grid {
    gap: 0 !important;
    row-gap: 0 !important;
    column-gap: 0 !important;
  }
  /* Remove any extra margin from Bootstrap g-4/g-3/g-2/g-1/g-0 utility classes if present */
  [class*="g-"] {
    margin-top: 0 !important;
    margin-bottom: 0 !important;
  }
  /* Video player full width, no negative margins */
  .card.mb-4,
  .card.mb-4 > .video-responsive,
  .card.mb-4 > #video-container,
  .video-responsive, #video-container {
    border-radius: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    position: relative;
  }
}

.nav-icon {
  font-size: 26px;
  margin-left: 20px;
  color: #333;
}

/* Mobile Footer Nav */
.mobile-footer {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60px;
  background: #fff;
  box-shadow: 0 -2px 4px rgba(0,0,0,0.07);
  z-index: 1040;
  justify-content: space-around;
  align-items: center;
  border-top: 1px solid #eee;
}
.mobile-footer .footer-item {
  flex: 1 1 0;
  text-align: center;
  color: #606060;
  font-size: 12px;
  text-decoration: none;
  padding: 5px 0 0 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.1s;
  cursor: pointer;
}
.mobile-footer .footer-item.active,
.mobile-footer .footer-item:hover {
  color: #d32f2f;
  background: #f5f5f5;
}
.mobile-footer .material-icons {
  font-size: 26px;
  margin: 0 0 2px 0;
}

/* Responsive video player for player.html */
.video-responsive {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  overflow: hidden;
}
.video-responsive iframe,
.video-responsive video,
.video-responsive img {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: cover;
  background: #000;
  display: block;
}
