/* Import Google Font and Font Awesome */
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;700&display=swap');
@import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css');

/* Root Variables */
:root {
  --primary-color: #1877f2;
  --background-color: #18191a;
  --text-color: #e4e6eb;
  --subtext-color: #b0b3b8;
  --white: #242526;
  --shadow: 0 2px 8px rgba(255, 255, 255, 0.05);
}

/* Reset & Base */
html, body {
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: var(--background-color);
  color: var(--text-color);
  transition: background-color 0.3s, color 0.3s;
}

body.adblock-active {
  overflow: hidden;
}

/* Header */
header {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header-content {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 24px;
}

.header-content a {
  text-decoration: none;
  color: var(--white);
  display: flex;
  align-items: center;
}

.site-logo {
  height: 50px;
  width: auto;
  border-radius: 6px;
}

/* Hamburger Menu */
.hamburger-menu {
  position: relative;
  display: inline-block;
}

#menu-toggle {
  all: unset;
  font-size: 28px;
  color: white !important;
  cursor: pointer;
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  text-shadow: none;
  -webkit-font-smoothing: none;
  -moz-osx-font-smoothing: auto;
}

#menu-toggle:hover {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  #menu-toggle {
    color: white !important;
  }
}

#menu-items {
  display: none;
  position: absolute;
  right: 0;
  margin-top: 12px;
  background-color: #2a2a2a;
  border-radius: 10px;
  overflow: hidden;
  min-width: 200px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.4);
  animation: fadeIn 0.3s ease;
  z-index: 1000;
}

#menu-items.show {
  display: block;
}

#menu-items a {
  display: block;
  padding: 14px 20px;
  color: #fff;
  text-decoration: none;
  border-bottom: 1px solid #3a3a3a;
  transition: background 0.2s;
  font-size: 14px;
}

#menu-items a:hover {
  background-color: #3b3b3b;
}

/* ==================== SEARCH BAR - FULLY FIXED ==================== */
.search-bar {
  position: relative;
  margin: 20px auto;
  max-width: 600px;
  display: flex;
  z-index: 10;                    /* LOWERED to avoid overlapping pagination */
  -webkit-transform: translateZ(0); /* Safari/iOS fix for stacking issues */
  transform: translateZ(0);
}

.search-bar input[type="text"] {
  flex: 1;
  padding: 10px 15px;
  font-size: 16px;
  border: 2px solid var(--primary-color);
  border-right: none;
  border-radius: 4px 0 0 4px;
  outline: none;
  background-color: var(--white);
  color: var(--text-color);
}

.search-bar button {
  background-color: var(--primary-color);
  border: 2px solid var(--primary-color);
  border-radius: 0 4px 4px 0;
  color: #2a2a2a;
  font-weight: 700;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-bar button:hover {
  background-color: #145dbf;
}

/* Dropdown Suggestions */
.search-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--white);
  border: 2px solid var(--primary-color);
  border-top: none;
  border-radius: 0 0 8px 8px;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
  z-index: 20;                    /* Higher than search bar but lower than pagination */
  display: none;
  -webkit-transform: translateZ(0); /* Safari/iOS fix */
  transform: translateZ(0);
}

.search-dropdown.show {
  display: block;
}

.dropdown-item {
  padding: 14px 16px;
  cursor: pointer;
  border-bottom: 1px solid #333;
  color: var(--text-color);
  font-size: 15px;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background-color: var(--primary-color);
  color: white;
  padding-left: 20px;
}

.dropdown-item:last-child {
  border-bottom: none;
}

/* Optional: Nice scrollbar for dropdown */
.search-dropdown::-webkit-scrollbar {
  width: 8px;
}
.search-dropdown::-webkit-scrollbar-track {
  background: #2a2a2a;
}
.search-dropdown::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}
.search-dropdown::-webkit-scrollbar-thumb:hover {
  background: #145dbf;
}
/* ==================== END OF SEARCH FIX ==================== */

/* Videos Container */
.videos-container {
  max-width: 1200px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  padding: 0 20px;
}

/* Video Cards */
.video-card {
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.video-card:hover {
  transform: translateY(-5px);
}

.video-card iframe,
.video-card img {
  width: 100%;
  height: 180px;
  border: none;
  object-fit: cover;
}

/* Video Info */
.video-info {
  margin-top: 10px;
  padding: 12px 15px;
}

.video-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0;
}

/* Pagination - FIXED for mobile overlap */
.pagination {
  text-align: center;
  margin: 40px 0 60px;           /* Increased margins for safety */
  padding: 15px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
  position: relative;
  z-index: 30;                    /* Highest z-index to stay on top */
  -webkit-transform: translateZ(0); /* Safari/iOS rendering fix */
  transform: translateZ(0);
  background: var(--background-color); /* Optional: solid background to prevent transparency issues */
}

.pagination a {
  display: inline-block;
  padding: 10px 15px;
  text-decoration: none;
  font-weight: bold;
  color: var(--primary-color);
  background: var(--white);
  border-radius: 6px;
  box-shadow: var(--shadow);
  transition: background 0.3s, color 0.3s;
}

.pagination a:hover {
  background: var(--primary-color);
  color: var(--white);
}

.pagination span.active {
  display: inline-block;
  padding: 10px 15px;
  font-weight: bold;
  color: #fff;
  background: var(--primary-color);
  border-radius: 6px;
  box-shadow: var(--shadow);
  cursor: default;
}

@media (max-width: 480px) {
  .pagination {
    gap: 12px;
    margin-top: 60px;            /* Even more space on small screens */
    margin-bottom: 80px;
  }
  
  .pagination a,
  .pagination span.active {
    padding: 10px 12px;
    font-size: 15px;
  }
}

/* Adblock Message Overlay */
#adblock-message {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  box-sizing: border-box;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  z-index: 9999;
  text-align: center;
  padding: 40px 20px;
  overflow: auto;
}

#adblock-message h2 {
  margin-top: 100px;
  font-size: 28px;
}

#adblock-message p {
  font-size: 18px;
  margin-top: 15px;
}

#adblock-message button {
  margin-top: 30px;
  padding: 10px 20px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
}

/* Hamburger Styling (legacy - kept untouched) */
#hamburger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#menu {
  position: absolute;
  top: 75px;
  right: 30px;
  background: var(--white);
  border-radius: 6px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-width: 120px;
  z-index: 1000;
}

#menu a.menu-item {
  color: var(--primary-color);
  padding: 10px 15px;
  text-decoration: none;
  font-weight: 700;
}

#menu a.menu-item:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none;
}

.description-section {
  text-align: center;
  margin: 30px 20px;
}

.description-section h2 {
  font-size: 24px;
  margin-bottom: 10px;
}

.description-section p {
  font-size: 18px;
  color: #ccc;
  max-width: 600px;
  margin: 0 auto;
}

/* Trending & Hottest nav buttons */
.header-nav-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.nav-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 8px;
  width: 44px;
  height: 44px;
  text-decoration: none;
  font-size: 20px;
  transition: opacity 0.2s, transform 0.2s;
}

.nav-icon-btn i {
  color: #fff !important;
}

.nav-icon-btn:hover {
  background: none;
  opacity: 0.8;
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .header-nav-buttons {
    gap: 6px;
    margin-right: 8px;
  }

  .nav-icon-btn {
    width: 36px;
    height: 36px;
    font-size: 16px;
    border-radius: 6px;
  }
}