/* General styles */
body {
    background-color: black;
    color: #ffffff;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
}

a {
    color: #ffc1c1;
    text-decoration: none;
}

/* Layout styles */
.container {
    max-width: 1250px;
    margin: 0 auto;
    padding: 1rem;
}

.container h1 {
    font-size: 25px;
}

h1,
h2,
h3 {
    color: #ffffff;
}

/* Video container styles */
.video-container {
    display: grid;
    gap: 10px;
}

/* Video card styles */
.video-card {
    color: #fff;
    overflow: hidden;
    text-align: center;
    position: relative;
    z-index: 1;
}

/* Thumbnail container with 16:9 aspect ratio */
.thumbnail-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background-color: black; /* Black background as placeholder */
    border-bottom: 2px solid #ffc1c1;
    overflow: hidden;
}

/* Thumbnail image */
.thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Ensures the image fits within the 16:9 container */
    transition: opacity 0.5s ease-in-out; /* Smooth transition when loaded */
    opacity: 0; /* Initially invisible */
}

/* Once the image has fully loaded, make it visible */
.thumbnail-container img.loaded {
    opacity: 1; /* Fade in the image */
}

.video-details {
    padding: 8px;
    position: relative;
}

.video-details h3 {
    font-size: 15px;
    margin: 0;
    text-align: left;
}

.video-details p {
    margin: 5px 0;
    text-align: left;
    font-size: 15px;
}

.video-link {
    position: relative;
    display: block;
}

.duration {
    position: absolute;
    bottom: 8px;
    right: 2px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
}

.video-info {
    position: absolute;
    bottom: 8px;
    left: 2px;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    /* Add space between items */
}

.videos-container {
    margin-bottom: 35px;
}

/* Pagination CSS */
.pagination {
    margin-top: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.pagination a {
    color: #ffffff;
    text-decoration: none;
    display: inline-block;
    padding: 8px 16px;
    transition: background-color 0.3s;
    margin: 2px;
}

.pagination a:hover {
    background-color: #ff8f8f;
}

.pagination .prev,
.pagination .next {
    background-color: #ffa9a9;
}

.pagination .number {
    background-color: #141414;
}

.pagination .disabled {
    pointer-events: none;
    color: #ccc;
}

.pagination .active {
    background-color: #ff8f8f;
    color: white;
}

.subscribe-button {
    background-color: #ffc1c1;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    justify-content: right;
}

/* Ad banner at the top for mobile */
.ad-banner-bottom {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
    margin-top: 30px;
}

.ad-banner-bottom img {
    width: 900px;
    height: 250px;
}

/* Flex container for the title and options button */
.title-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.video-title {
    flex: 1;
    margin: 0;
    padding-right: 10px;
    /* Add padding to avoid overlap with the button */
    white-space: nowrap;
    /* Prevents text wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-title h1 {
    word-wrap: break-word;
    white-space: normal; /* Allow wrapping */
    overflow: hidden;
    line-height: 1.2em; /* Adjust for readability */
    max-height: none; /* Allow for multiple lines */
    margin: 0;
    padding-right: 10px;
}

.article-container {
    max-width: 1113px;
    margin: 30px auto;
    padding: 20px;
    background-color: #141414;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
}

.article-content {
    margin-top: 20px;
    line-height: 1.6;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 20px;
    color: #ffc1c1;
}

.article-content p {
    margin-bottom: 15px;
}

.social-buttons {
    margin-top: 10px;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.social-buttons a {
    margin: 5px;
    text-decoration: none;
    flex: 0 0 auto;
}

.social-buttons a img {
    width: 40px;
    height: 40px;
    border-radius: 5px;
    transition: background-color 0.3s, color 0.3s;
}

.social-buttons a:hover img {
    background-color: #ff8f8f;
    color: #fff;
}


/* Sorting Options Container */
.sorting-options {
    margin-bottom: 20px;
    display: flex;
    gap: 10px; /* Adds space between buttons */
}

/* Base Button Style (Matching your old .sorting-options a) */
.sorting-options .sort-btn {
    background: none; /* Removes default button gray */
    border: 1px solid transparent; 
    cursor: pointer;
    font-family: inherit;
    font-size: inherit;
    
    text-decoration: none;
    color: #ffc1c1; 
    padding: 10px 20px; 
    border-radius: 5px; 
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Active and Hover States */
.sorting-options .sort-btn.active,
.sorting-options .sort-btn:hover {
    background-color: #ffc1c1;
    color: #fff;
    border-color: #ffb3b3;
}

/* Tab Content */
.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Ad banner at the top for mobile */
.ad-banner-top {
    display: none;
    width: 100%;
    text-align: center;
    margin-bottom: 20px;
}

.ad-banner-top img {
    width: 300px;
    height: 100px;
}

/* ======================
   CATEGORIES – PREMIUM GRID
====================== */

.page-title {
  font-size: 22px;
  font-weight: 700;
  margin: 20px 0 18px;
  color: #fff;
}

/* GRID */
.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

/* CARD */
.category-card {
  position: relative;
  background: linear-gradient(180deg, #1b1b1b, #111);
  padding: 18px 12px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.2px;

  border: 1px solid rgba(255,255,255,0.06);
  box-shadow:
    0 6px 14px rgba(0,0,0,0.45);

  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

/* ORANGE ACCENT BAR (PornHub vibe) */
.category-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: #ffc1c1;
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* TEXT */
.category-card span {
  display: block;
  line-height: 1.3;
  text-transform: capitalize;
}

/* HOVER */
.category-card:hover {
  transform: translateY(-4px);
  box-shadow:
    0 10px 22px rgba(0,0,0,0.65);
  background: linear-gradient(180deg, #222, #141414);
}

.category-card:hover::before {
  opacity: 1;
}

/* ACTIVE / TAP (MOBILE) */
.category-card:active {
  transform: scale(0.97);
}

/* RESPONSIVE TWEAKS */
@media (max-width: 480px) {
  .categories-grid {
    gap: 12px;
  }

  .category-card {
    padding: 16px 8px;
    font-size: 13px;
  }
}

/* Media queries */
@media screen and (max-width: 768px) {
    .video-container {
        grid-template-columns: 1fr;
    }

    .ad-banner-bottom {
        display: none;
    }

    .article-container {
        padding: 15px;
        max-width: 350px;
    }

    .video-card {
        width: 100vw;
        margin: 0;
    }

    .container {
        padding: 0;
    }

    .container h1 {
        font-size: 25px;
        margin-left: 10px;
    }

    .video-container {
        gap: 10px;
    }

    .ad-banner-top {
        display: block;
        margin-top: 30px;
    }

    .sorting-options {
        margin-left: 10px;
    }
}

@media screen and (min-width: 769px) {
    .video-container {
        grid-template-columns: repeat(4, 1fr);
    }
}
