/* style.css - base light mode */

@import 'header.css';
@import 'footer.css';

html {
    scrollbar-gutter: stable;
}

body {
    margin: 0;
    font-family: 'Roboto', sans-serif;
    background-color: white;
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Android tap highlight fix for all links */
a, a:visited, a:active, a:hover {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

/* Additional fix for buttons and clickable elements */
button, .menu-toggle, .search-button, .mobile-menu-close {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
}

canvas { /* used in admin panel */
    width: 100%;
    height: auto;
    display: block;
    margin-top: 0.625rem;
    image-rendering: auto;
}

.site-main {
    background-color: white;
    margin-top: 0;
    flex: 1;
}

.main-container {
    background-color: white;
    max-width: 1560px;
    margin: 0 auto;
    padding: 0 1.25rem 0 1.25rem;
}

.section-heading {
    font-size: 1.5rem;
    text-align: left;
    margin: 1rem 0 0 0;
}

.section-heading-meta {
    color: #666;
    font-weight: normal;
    font-size: 0.8em;
}

.section-subheading-block {
    margin: 2rem 0 0.5rem 0;
}

.section-subheading-block .section-subheading {
    font-size: 1.5rem;
    font-weight: 600;
    text-align: left;
    margin: 0;
    color: #222;
}

.section-subheading-block .section-subheading-note {
    font-size: 0.875rem;
    color: #666;
    margin: 0;
    line-height: 1.35;
}

/* Ensure the very first page heading doesn't add extra gap below the header */
.main-container > .section-heading:first-child {
    margin-top: 0;
}

.video-grid-wrapper {
    container-type: inline-size;
    container-name: video-grid-responsive;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
    gap: 0.625rem;
    justify-content: center;
    width: 100%;
    max-width: 1560px;
    margin: 1rem auto 0 auto;
    background-color: white;
}

@container video-grid-responsive (max-width: 931px) {
    .video-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    }
}

.image-grid-wrapper {
    container-type: inline-size;
    container-name: image-grid-responsive;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(304px, 1fr));
    gap: 0.625rem;
    justify-content: center;
    width: 100%;
    max-width: 1560px;
    margin: 1rem auto 0 auto;
    background-color: white;
}

@container image-grid-responsive (max-width: 931px) {
    .image-grid {
        grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    }
}

.video-card {
    background-color: white;
    padding-bottom: 0.75rem;
}

.video-card a {
    text-decoration: none;
    color: inherit;
}

.image-card {
    background-color: white;
    padding-bottom: 1.5rem;
}

.image-card a {
    text-decoration: none;
    color: inherit;
}

.image-title {
    text-align: center;
    margin-top: 0.375rem;
    font-size: 1rem;
    line-height: 1.2;
    max-height: 2.4em; /* 2 lines × 1.2 line-height */
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background-color: #eee;
}

.thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(0, 0, 0, 0.85);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    z-index: 2;
    min-width: 32px;
    text-align: center;
}

.video-title {
    margin-top: 0.375rem;
    font-size: 0.875rem;
    text-align: left;
    line-height: 1.2;
    max-height: 2.4em; /* Increased to ensure 2 lines are fully visible */
    overflow: hidden;
    text-overflow: ellipsis;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

/* PAGINATION STYLES */

.pagination-nav {
    background-color: white;
    margin: 1rem 0 0 0;
    display: flex;
    justify-content: center;
}

.pagination {
    background-color: white; 
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
    padding: 0;
    margin: 0;
}

.pagination li {
    display: inline-block;
}

/* Shared styling for links and span */

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0px;
    text-decoration: none;
    font-size: 0.875rem;
    color: #1a1a1a;
}

/* Active page */

.pagination .active span {
    background-color: #e7312c;
    color: white;
    border-color: #e7312c;
}

/* Dots */

.pagination .dots span {
    border: none;
    padding: 0.5rem 0.75rem;
    color: #1a1a1a;
}

/* Arrows (optional styling) */

.pagination .nav-arrow {
    font-weight: bold;
}

/* VIDEO INFO ROW */

.video-classification {
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: left;
    margin: 1em 0 0 0;
}

/* PILLS */

.category-pill-container {
    background-color: white;
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
    justify-content: flex-start;
    margin: 1rem 0;
    max-height: 4.5rem;
    overflow: hidden;
}

/* Avoid doubling the header-to-content gap when pills are the first element */
.main-container > .category-pill-container:first-child {
    margin-top: 0;
}

.pill {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    border-radius: 0px;
    font-size: 0.875rem;
    text-decoration: none;
}

.category-pill {
    background-color: #e7312c;
    color: white;
}

.pornstar-pill {
    background-color: #333;
    color: #fff;
}

.tag-pill {
    background-color: #eee;
    color: #333;
}

.video-player-container {
    background-color: white;
    width: 100%;
    max-width: 1560px;
    margin: 0 auto;
    padding: 1.25rem 0;
    line-height: 0;
}

.video-js {
    display: block;
    line-height: 0;
    width: 100%;
    max-width: 960px;
    height: auto;
    background-color: #1a1a1a;
    aspect-ratio: 16 / 9;
}

.video-description {
    max-width: 960px;
    margin: 0;
    padding: 0 0 0.625rem 0;
    font-size: 1rem;
    background-color: white;
    white-space: normal;
    word-wrap: break-word;
}

/* Alphabet navigation */

.alphabet-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.alphabet-bar a {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    margin: 0 0.25rem;
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid #ddd;
    border-radius: 0px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.alphabet-bar a:hover {
    background-color: #ffe6e6;
    color: #e7312c;
    border-color: #e7312c;
}

.alphabet-bar a.active {
    background-color: #e7312c;
    color: #fff;
    border-color: #e7312c;
}

/* Tag grid — fixed column slots (max 5); sparse rows do not stretch items */

.tag-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.tag-grid a {
    display: block;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    margin: 0;
    text-align: center;
    text-decoration: none;
    color: #1a1a1a;
    border: 1px solid #ddd;
    border-radius: 0;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tag-grid a:hover {
    background-color: #ffe6e6;
    color: #e7312c;
    border-color: #e7312c;
}

@media (max-width: 1100px) {
    .tag-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .tag-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .tag-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Video Player Settings Menu */

.video-js .vjs-settings-button {
    cursor: pointer;
    flex: none;
    width: 3em;
    order: 1;
    position: relative;
    /* Mobile-specific improvements */
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background: transparent;
    outline: none;
    border: none;
    /* Ensure button is clickable */
    z-index: 10;
    pointer-events: auto;
    /* Ensure icon doesn't inherit larger size */
    font-size: inherit;
}

/* HD Indicator */
.video-js .vjs-settings-button .hd-indicator {
    position: absolute;
    top: -2px;
    right: -2px;
    background-color: #e7312c;
    color: white;
    font-size: 0.6rem;
    font-weight: bold;
    padding: 1px 3px;
    border-radius: 2px;
    line-height: 1;
    min-width: 16px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    z-index: 10;
}

/* Mobile HD indicator adjustments */
@media (max-width: 768px) {
    .video-js .vjs-settings-button .hd-indicator {
        font-size: 0.5rem;
        padding: 2px 4px;
        min-width: 14px;
        top: -1px;
        right: -1px;
        border-radius: 3px;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    }
}

.video-js .vjs-fullscreen-control {
    order: 2;
}

.video-js .vjs-settings-button .vjs-icon-placeholder {
    font-family: VideoJS;
    font-weight: normal;
    font-style: normal;
    /* Ensure icon is visible */
    color: #fff;
    line-height: 1;
}

.video-js .vjs-settings-button .vjs-icon-placeholder:before {
    content: "\f114";
}

/* New Floating Quality Selector */
.video-js .vjs-settings-menu {
    position: absolute;
    bottom: 60px; /* Position above control bar */
    right: 10px;
    width: 120px;
    background: rgba(28, 28, 28, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 8px 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
}

.video-js .vjs-settings-menu.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.video-js .vjs-settings-menu .vjs-menu-item {
    padding: 10px 16px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    text-align: left;
    font-weight: 500;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Mobile touch improvements */
    -webkit-tap-highlight-color: transparent;
    min-height: 44px; /* iOS minimum touch target */
}

.video-js .vjs-settings-menu .vjs-menu-item:hover {
    background-color: rgba(231, 49, 44, 0.2);
    color: #fff;
}

.video-js .vjs-settings-menu .vjs-menu-item.selected {
    color: #e7312c;
    background-color: rgba(231, 49, 44, 0.1);
}

.video-js .vjs-settings-menu .vjs-menu-item.selected::after {
    content: "✓";
    color: #e7312c;
    font-weight: bold;
    margin-left: 8px;
}

/* Quality indicator for selected item */
.video-js .vjs-settings-menu .vjs-menu-item .quality-indicator {
    font-size: 11px;
    opacity: 0.7;
    margin-left: 8px;
}

.video-js .vjs-settings-menu .vjs-menu-item.selected .quality-indicator {
    opacity: 1;
    color: #e7312c;
}

/* Arrow pointing to settings button */
.video-js .vjs-settings-menu::after {
    content: "";
    position: absolute;
    bottom: -6px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(28, 28, 28, 0.95);
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .video-js .vjs-settings-menu {
        bottom: 70px;
        right: 5px;
        width: 110px;
        padding: 6px 0;
    }
    
    .video-js .vjs-settings-menu .vjs-menu-item {
        padding: 8px 12px;
        font-size: 13px;
        min-height: 44px; /* iOS minimum touch target */
    }
}

/* Video Preview Styles */

.video-card > a {
    position: relative;
    display: block;
}

.preview-player {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    background-color: #000;
    z-index: 1;
}

.preview-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: rgba(255, 255, 255, 0.8);
    z-index: 3;
    transition: width 300ms linear;
    opacity: 1;
    transition-property: width, opacity;
}

.video-card:hover > a .preview-progress {
    width: 100%;
}

.video-card:not(:hover) > a .preview-progress {
    opacity: 0;
    width: 0;
    transition: opacity 0s;
}

.video-card:hover > a .preview-player {
    display: block;
}

/* Video Player Controls */
.video-js .vjs-control-bar {
    height: 4em;
    padding: 0 0.5em;
}

/* iOS Video Player Fixes */
.video-js,
.video-js video,
.video-js .vjs-tech,
.video-js .vjs-poster,
.video-js .vjs-big-play-button,
.video-js .vjs-control-bar,
.video-js .vjs-button,
.video-js .vjs-progress-control,
.video-js .vjs-progress-holder,
.video-js .vjs-play-progress,
.video-js .vjs-load-progress,
.video-js .vjs-time-tooltip,
.video-js .vjs-play-control,
.video-js .vjs-volume-panel,
.video-js .vjs-volume-control,
.video-js .vjs-volume-level,
.video-js .vjs-fullscreen-control,
.video-js .vjs-settings-button,
.video-js .vjs-settings-menu,
.video-js .vjs-menu-item {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-action: manipulation !important;
    touch-action: manipulation !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    outline: none !important;
}

/* Specific fix for video element on iOS */
video {
    -webkit-tap-highlight-color: transparent !important;
    -webkit-touch-callout: none !important;
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-touch-action: manipulation !important;
    touch-action: manipulation !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    outline: none !important;
}

/* Remove iOS default video styling */
video::-webkit-media-controls {
    display: none !important;
}

video::-webkit-media-controls-panel {
    display: none !important;
}

video::-webkit-media-controls-play-button {
    display: none !important;
}

video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

.video-js .vjs-button {
    width: 4em;
    height: 4em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
}

.video-js .vjs-icon-placeholder:before {
    line-height: 1;
    font-size: 2.7em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-js .vjs-progress-control {
    height: 4em;
}

.video-js .vjs-volume-panel {
    height: 4em;
}

.video-js .vjs-time-control {
    line-height: 4em;
    font-size: 1.3em;
}

.video-js .vjs-progress-holder {
    height: 0.5em;
}

.video-js .vjs-play-progress {
    height: 0.5em;
}

.video-js .vjs-slider {
    height: 0.5em;
}

.video-js .vjs-volume-level {
    height: 0.5em;
}

/* Remove rectangle from big play button */
.video-js .vjs-big-play-button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
}

/* STATIC PAGE STYLES */
.static-content {
    background-color: white;
}

.static-content h1 {
    font-size: 1.5rem;
    color: #333;
}

.static-content h2 {
    font-size: 1.5rem;
    color: #333;
}

.static-content p {
    margin-bottom: 1rem;
    color: #1a1a1a;
}

.static-content strong {
    color: #333;
    font-weight: 600;
}

/* Static page link styling (brand color) */
.static-content a {
    color: #e7312c;
    text-decoration: underline;
}

.static-content a:visited {
    color: #e7312c;
}

.static-content a:hover {
    color: #e7312c;
    text-decoration: underline;
}

/* Allow selecting/copying links on static pages */
.static-content a,
.static-content a:visited,
.static-content a:active,
.static-content a:hover {
    -webkit-user-select: text !important;
    -moz-user-select: text !important;
    -ms-user-select: text !important;
    user-select: text !important;
    -webkit-touch-callout: default !important;
}

/* Increase space between list elements on static pages */
.static-content li {
    margin-bottom: 1rem;
}