* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    background-color: #000;
    color: #fff;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background-color: #1a1a1a;
    padding: 15px 0;
    border-bottom: 1px solid #2a2a2a;
}

.header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    color: #fff;
}

.logo-highlight {
    color: #ff9000;
}

.search-bar {
    flex: 1;
    max-width: 600px;
    display: flex;
    gap: 10px;
}

.search-bar input {
    flex: 1;
    padding: 10px 15px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
}

.search-bar input:focus {
    outline: none;
    border-color: #ff9000;
}

.search-btn {
    padding: 10px 25px;
    background-color: #ff9000;
    border: none;
    border-radius: 4px;
    color: #000;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #ffa500;
}

.upload-btn {
    padding: 10px 20px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.3s;
}

.upload-btn:hover {
    background-color: #3a3a3a;
}

/* Navigation */
.nav {
    background-color: #1a1a1a;
    padding: 12px 0;
    border-bottom: 1px solid #2a2a2a;
}

.nav .container {
    display: flex;
    gap: 25px;
}

.nav-link {
    color: #ccc;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
}

.nav-link:hover,
.nav-link.active {
    color: #ff9000;
}

/* Main Content */
.main {
    padding: 30px 0;
}

.section-title {
    font-size: 24px;
    margin-bottom: 20px;
    color: #fff;
}

/* Categories */
.categories-section {
    margin-bottom: 50px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.category-card {
    position: relative;
    min-height: 100px;
    background-color: #2a2a2a;
    border: 2px solid #3a3a3a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 20px;
}

.category-card:hover {
    background-color: #1e3a8a;
    border-color: #3b82f6;
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.category-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.7));
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    text-align: center;
    width: 100%;
}

/* Videos Grid */
.videos-section {
    margin-bottom: 50px;
}

.videos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.video-card {
    background-color: #1a1a1a;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
}

.video-card:hover {
    transform: translateY(-5px);
}

.video-thumbnail {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    background-color: #2a2a2a;
    overflow: hidden;
}

.video-thumbnail img,
.video-thumbnail .thumbnail-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Hover preview effect */
.video-thumbnail .preview-gif {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-card:hover .video-thumbnail .preview-gif {
    opacity: 1;
}

.video-card:hover .video-thumbnail img:not(.preview-gif) {
    opacity: 0;
}

/* Simple preview image that shows on hover */
.video-thumbnail .preview-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.video-card:hover .video-thumbnail .preview-image {
    opacity: 1;
}

.video-card:hover .video-thumbnail .thumbnail-static {
    opacity: 0;
}

/* Preview loading indicator */
.video-thumbnail .preview-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #ff9000;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.video-card:hover .video-thumbnail .preview-loading {
    opacity: 1;
}

/* Hover zoom effect removed - using preview image instead */

/* Preview play icon */
.video-thumbnail .preview-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(255, 144, 0, 0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
    pointer-events: none;
}

.video-thumbnail .preview-play-icon::after {
    content: '';
    width: 0;
    height: 0;
    border-left: 20px solid #000;
    border-top: 12px solid transparent;
    border-bottom: 12px solid transparent;
    margin-left: 5px;
}

.video-card:hover .video-thumbnail .preview-play-icon {
    opacity: 0.8;
}

/* Smooth hover transition */
.video-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    box-shadow: 0 8px 16px rgba(255, 144, 0, 0.3);
}

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.8);
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
}

.video-quality {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: rgba(255, 144, 0, 0.9);
    color: #000;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.video-info {
    padding: 12px;
}

.video-title {
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 8px;
    color: #fff;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.video-channel {
    font-size: 12px;
    color: #ff9000;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: #999;
}

.video-meta .views {
    display: flex;
    align-items: center;
    gap: 4px;
}

.video-meta .views .count {
    font-weight: bold;
    color: #fff;
}

.video-meta .videoInfo {
    color: #999;
    font-size: 11px;
}

/* Footer */
.footer {
    background-color: #1a1a1a;
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #2a2a2a;
    margin-top: 50px;
}

.footer p {
    color: #999;
    font-size: 14px;
}

/* Responsive - Mobile First Approach */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }

    .videos-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 15px;
    }

    .categories-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }
}

/* Mobile (max-width: 768px) */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    /* Header Mobile */
    .header {
        padding: 10px 0;
    }

    .header .container {
        flex-direction: column;
        gap: 10px;
    }

    .logo-text {
        font-size: 24px;
    }

    .search-bar {
        width: 100%;
        max-width: 100%;
    }

    .search-bar input {
        padding: 12px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .search-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Navigation Mobile */
    .nav {
        padding: 0;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav .container {
        gap: 0;
        padding: 0;
        display: flex;
        flex-wrap: nowrap;
        min-width: min-content;
    }

    .nav-link {
        padding: 12px 15px;
        white-space: nowrap;
        font-size: 13px;
        border-bottom: 2px solid transparent;
    }

    .nav-link.active {
        border-bottom-color: #ff9000;
    }

    /* Main Content Mobile */
    .main {
        padding: 15px 0;
    }

    .section-title {
        font-size: 20px;
        margin-bottom: 15px;
    }

    /* Section Header Mobile */
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .sort-bar {
        width: 100%;
    }

    .sort-select {
        width: 100%;
        padding: 10px 35px 10px 12px;
        font-size: 16px; /* Prevents zoom on iOS */
    }

    /* Categories Grid Mobile */
    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .category-card {
        min-height: 70px;
        padding: 15px;
    }

    .category-name {
        font-size: 14px;
    }

    /* Videos Grid Mobile */
    .videos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .video-card {
        border-radius: 6px;
    }

    .video-thumbnail {
        border-radius: 6px 6px 0 0;
    }

    .video-duration {
        bottom: 6px;
        right: 6px;
        padding: 2px 5px;
        font-size: 11px;
    }

    .video-quality {
        top: 6px;
        left: 6px;
        padding: 2px 6px;
        font-size: 10px;
    }

    .video-info {
        padding: 8px;
    }

    .video-title {
        font-size: 13px;
        margin-bottom: 6px;
        -webkit-line-clamp: 2;
    }

    .video-channel {
        font-size: 11px;
        margin-bottom: 4px;
    }

    .video-meta {
        font-size: 11px;
        gap: 3px;
    }

    /* Pagination Mobile */
    .pagination {
        gap: 5px;
        padding: 15px 0;
        margin: 20px 0;
        flex-wrap: wrap;
    }

    .pagination-btn {
        padding: 8px 12px;
        font-size: 13px;
        min-width: 35px;
    }

    .pagination-info {
        font-size: 12px;
        width: 100%;
        text-align: center;
        order: -1;
        margin-bottom: 10px;
    }

    /* Footer Mobile */
    .footer {
        padding: 20px 0;
        margin-top: 30px;
    }

    .footer p {
        font-size: 12px;
    }

    /* Hover Effects - Disable on Mobile */
    .video-card:hover {
        transform: none;
        box-shadow: none;
    }

    .category-card:hover {
        transform: none;
    }

    /* Preview disabled on mobile for performance */
    .video-thumbnail .preview-video,
    .video-thumbnail .preview-image,
    .video-thumbnail .preview-gif {
        display: none !important;
    }

    .hover-video-player {
        display: none !important;
    }
}

/* Small Mobile (max-width: 480px) */
@media (max-width: 480px) {
    .container {
        padding: 0 8px;
    }

    .logo-text {
        font-size: 20px;
    }

    .search-bar {
        gap: 8px;
    }

    .search-bar input {
        padding: 10px 12px;
    }

    .search-btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .nav-link {
        padding: 10px 12px;
        font-size: 12px;
    }

    .section-title {
        font-size: 18px;
    }

    .videos-grid {
        gap: 8px;
    }

    .video-info {
        padding: 6px;
    }

    .video-title {
        font-size: 12px;
    }

    .video-channel {
        font-size: 10px;
    }

    .video-meta {
        font-size: 10px;
    }

    .pagination-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 30px;
    }
}

/* Landscape Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .videos-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header .container {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .search-bar {
        flex: 1;
        min-width: 300px;
    }
}

/* Touch-friendly improvements */
@media (hover: none) and (pointer: coarse) {
    /* Larger tap targets for mobile */
    .nav-link,
    .search-btn,
    .pagination-btn,
    .category-card,
    .video-card {
        min-height: 44px; /* iOS recommended tap target */
    }

    /* Remove hover states on touch devices */
    .video-card:hover .video-thumbnail .preview-video,
    .video-card:hover .video-thumbnail .preview-image,
    .video-card:hover .video-thumbnail .preview-gif {
        opacity: 0;
        display: none;
    }

    .video-card:hover .video-thumbnail img:not(.preview-gif) {
        opacity: 1;
    }
}


/* Video preview on hover - XVideos style */
.video-thumbnail .preview-video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.video-card:hover .video-thumbnail .preview-video {
    opacity: 1;
}

.video-card:hover .video-thumbnail .thumbnail-static {
    opacity: 0;
}


/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 40px 0;
    padding: 20px 0;
}

.pagination-btn {
    padding: 10px 15px;
    background: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 14px;
    min-width: 40px;
    text-align: center;
}

.pagination-btn:hover:not(:disabled) {
    background: #ff9000;
    color: #000;
    border-color: #ff9000;
}

.pagination-btn.active {
    background: #ff9000;
    color: #000;
    border-color: #ff9000;
    font-weight: bold;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-info {
    color: #999;
    font-size: 14px;
    margin: 0 10px;
}


/* Categories Page */
.categories-section {
    padding: 40px 0;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.category-card {
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 20px;
    text-decoration: none;
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.3s;
    cursor: pointer;
    min-height: 80px;
}

.category-card:hover {
    background: #2a2a2a;
    border-color: #ff9000;
    transform: translateY(-2px);
}

.category-info {
    width: 100%;
    text-align: center;
}

.category-name {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    text-align: center;
}

.category-count {
    font-size: 12px;
    color: #999;
}

.category-arrow {
    display: none;
}


/* Hover Video Player */
.hover-video-player {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 10;
    border-radius: 8px;
    overflow: hidden;
}

.hover-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hover-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.hover-scrubber {
    width: 100%;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255, 255, 255, 0.3);
    outline: none;
    border-radius: 2px;
    cursor: pointer;
}

.hover-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    background: #ff9000;
    cursor: pointer;
    border-radius: 50%;
}

.hover-scrubber::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #ff9000;
    cursor: pointer;
    border-radius: 50%;
    border: none;
}

.hover-time {
    font-size: 11px;
    color: #fff;
    text-align: center;
}

.hover-time span {
    font-weight: bold;
}

/* Sort Bar */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.sort-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-bar label {
    color: #999;
    font-size: 14px;
}

.sort-select {
    padding: 8px 30px 8px 12px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: all 0.3s;
}

.sort-select:hover {
    border-color: #ff9000;
    background-color: #333;
}

.sort-select:focus {
    outline: none;
    border-color: #ff9000;
}

.sort-select option {
    background-color: #2a2a2a;
    color: #fff;
}
