/* Video Page Specific Styles */

/* Video Layout */
.video-page-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    margin-bottom: 40px;
}

.video-main {
    min-width: 0;
}

/* ========================================
   Custom Video Player
   ======================================== */

.custom-player {
    position: relative;
    background: #000;
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
    width: 100%;
    aspect-ratio: 16/9;
    user-select: none;
}

.custom-player video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Play overlay */
.player-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
    transition: opacity 0.3s;
    z-index: 10;
}

.player-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.big-play-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--primary);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background 0.2s;
}

.big-play-btn:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.big-play-btn svg {
    width: 40px;
    height: 40px;
    fill: #fff;
    margin-left: 5px;
}

/* Loading spinner */
.player-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    z-index: 15;
    transition: opacity 0.2s;
}

.player-loading.visible {
    opacity: 1;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Controls */
.player-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.8));
    padding: 40px 16px 12px;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s, transform 0.3s;
    z-index: 20;
}

.custom-player:hover .player-controls,
.custom-player.controls-visible .player-controls,
.custom-player:not(.playing) .player-controls {
    opacity: 1;
    transform: translateY(0);
}

/* Progress container */
.progress-container {
    position: relative;
    padding: 10px 0;
    cursor: pointer;
    margin-bottom: 8px;
}

.progress-bar {
    position: relative;
    height: 5px;
    background: rgba(255,255,255,0.3);
    border-radius: 3px;
    transition: height 0.1s;
}

.progress-container:hover .progress-bar {
    height: 7px;
}

.progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255,255,255,0.4);
    border-radius: 3px;
    width: 0%;
}

.progress-played {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    width: 0%;
}

.progress-handle {
    position: absolute;
    top: 50%;
    left: 0%;
    width: 14px;
    height: 14px;
    background: var(--primary);
    border-radius: 50%;
    transform: translate(-50%, -50%) scale(0);
    transition: transform 0.15s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.progress-container:hover .progress-handle {
    transform: translate(-50%, -50%) scale(1);
}

/* Preview tooltip */
.preview-tooltip {
    position: absolute;
    bottom: 30px;
    left: 0;
    background: #000;
    border-radius: 6px;
    padding: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 30;
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.preview-tooltip.visible {
    opacity: 1;
}

.preview-tooltip img {
    display: block;
    width: 160px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    background: #222;
}

.preview-tooltip .preview-time {
    display: block;
    text-align: center;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 0 2px;
}

/* Controls row */
.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.controls-left,
.controls-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Control buttons */
.ctrl-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.ctrl-btn:hover {
    background: rgba(255,255,255,0.15);
}

.ctrl-btn svg {
    width: 24px;
    height: 24px;
}

/* Play/pause button icons */
.custom-player .icon-pause,
.custom-player.playing .icon-play {
    display: none;
}

.custom-player.playing .icon-pause {
    display: block;
}

/* Volume control */
.volume-control {
    display: flex;
    align-items: center;
}

.volume-slider-container {
    width: 0;
    overflow: hidden;
    transition: width 0.2s;
}

.volume-control:hover .volume-slider-container {
    width: 80px;
}

.volume-slider {
    width: 70px;
    height: 4px;
    -webkit-appearance: none;
    appearance: none;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    cursor: pointer;
    margin-left: 4px;
}

.volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
}

.volume-slider::-moz-range-thumb {
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    border: none;
}

/* Volume icons */
.custom-player .icon-volume-low,
.custom-player .icon-volume-mute {
    display: none;
}

.custom-player.volume-high .icon-volume-high { display: block; }
.custom-player.volume-high .icon-volume-low,
.custom-player.volume-high .icon-volume-mute { display: none; }

.custom-player.volume-low .icon-volume-low { display: block; }
.custom-player.volume-low .icon-volume-high,
.custom-player.volume-low .icon-volume-mute { display: none; }

.custom-player.volume-mute .icon-volume-mute { display: block; }
.custom-player.volume-mute .icon-volume-high,
.custom-player.volume-mute .icon-volume-low { display: none; }

/* Time display */
.time-display {
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    margin-left: 8px;
    white-space: nowrap;
}

/* Speed and quality controls */
.speed-control,
.quality-control {
    position: relative;
}

.speed-btn,
.quality-btn {
    font-size: 12px;
    font-weight: 600;
    padding: 0 8px;
    min-width: auto;
    width: auto;
    height: 32px;
}

.speed-menu,
.quality-menu {
    position: absolute;
    bottom: 100%;
    right: 0;
    background: rgba(30,30,30,0.95);
    border-radius: 8px;
    padding: 8px 0;
    min-width: 100px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s;
    z-index: 40;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.speed-menu.visible,
.quality-menu.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(-8px);
}

.speed-menu button,
.quality-menu button {
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.speed-menu button:hover,
.quality-menu button:hover {
    background: rgba(255,255,255,0.1);
}

.speed-menu button.active,
.quality-menu button.active {
    background: var(--primary);
}

/* Fullscreen button icons */
.custom-player .icon-compress {
    display: none;
}

.custom-player.fullscreen .icon-expand {
    display: none;
}

.custom-player.fullscreen .icon-compress {
    display: block;
}

/* Fullscreen mode */
.custom-player.fullscreen {
    border-radius: 0;
}

/* Skip buttons text */
.skip-btn svg text {
    font-weight: 700;
}

/* ========================================
   Video Info Section
   ======================================== */

.video-info-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.video-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.video-info-section .video-title {
    font-size: 1.2rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0;
    flex: 1;
}

.video-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-pill);
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn svg {
    width: 18px;
    height: 18px;
}

.vote-btn:hover {
    background: var(--border);
}

.vote-btn.like-btn:hover,
.vote-btn.like-btn.voted {
    background: rgba(76, 175, 80, 0.2);
    border-color: #4caf50;
    color: #4caf50;
}

.vote-btn.like-btn.voted svg {
    fill: #4caf50;
}

.vote-btn.dislike-btn:hover,
.vote-btn.dislike-btn.voted {
    background: rgba(244, 67, 54, 0.2);
    border-color: #f44336;
    color: #f44336;
}

.vote-btn.dislike-btn.voted svg {
    fill: #f44336;
}

.vote-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Download Button */
.download-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: var(--radius-pill);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.download-btn svg {
    width: 18px;
    height: 18px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 64, 129, 0.4);
}

.video-info-section .video-meta {
    display: flex;
    gap: 20px;
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.video-info-section .video-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.video-info-section .video-meta svg {
    width: 16px;
    height: 16px;
}

.video-info-section .video-models {
    margin-bottom: 12px;
}

.video-info-section .video-models strong {
    color: var(--text-muted);
    margin-right: 8px;
}

.video-info-section .video-models a {
    color: var(--primary);
}

.video-info-section .video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* ========================================
   Comments Section
   ======================================== */

.comments-section {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
}

.comments-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.comments-title svg {
    width: 20px;
    height: 20px;
}

.comments-count {
    color: var(--text-muted);
    font-weight: 400;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}

.comment-form input,
.comment-form textarea {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.comment-form input:focus,
.comment-form textarea:focus {
    border-color: var(--primary);
}

.comment-form textarea {
    resize: vertical;
    min-height: 80px;
}

.comment-form button {
    align-self: flex-end;
    padding: 12px 24px;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-pill);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.comment-form button:hover {
    background: var(--primary-dark);
}

.comment-form button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.comment {
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.comment:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--primary);
}

.comment-date {
    font-size: 13px;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text);
    line-height: 1.5;
    font-size: 14px;
}

.loading {
    text-align: center;
    padding: 20px;
    color: var(--text-muted);
}

.load-more-comments {
    width: 100%;
    padding: 12px;
    margin-top: 16px;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

.load-more-comments:hover {
    background: var(--border);
}

.no-comments {
    text-align: center;
    padding: 30px;
    color: var(--text-muted);
}

/* ========================================
   Sidebar
   ======================================== */

.video-sidebar {
    position: sticky;
    top: 80px;
    height: fit-content;
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text);
}

.sidebar-videos {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-video {
    display: flex;
    gap: 12px;
    text-decoration: none;
    color: var(--text);
    transition: transform 0.2s;
}

.sidebar-video:hover {
    transform: translateX(4px);
}

.sidebar-video .thumb {
    position: relative;
    width: 140px;
    min-width: 140px;
    aspect-ratio: 16/9;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-hover);
}

.sidebar-video .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s;
}

.sidebar-video .thumb img[data-src] {
    opacity: 0;
}

.sidebar-video .thumb img.loaded,
.sidebar-video .thumb img:not([data-src]) {
    opacity: 1;
}

.sidebar-video .thumb .duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0,0,0,0.85);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
}

.sidebar-video .info h4 {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sidebar-video:hover .info h4 {
    color: var(--primary);
}

.sidebar-video .info .views {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================
   More Videos Grid
   ======================================== */

.more-videos-section {
    margin-top: 40px;
}

.more-videos-section h2 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 1100px) {
    .video-page-layout {
        grid-template-columns: 1fr;
    }
    
    .video-sidebar {
        position: static;
        margin-top: 24px;
    }
    
    .sidebar-videos {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .sidebar-video {
        flex-direction: column;
    }
    
    .sidebar-video .thumb {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .video-title-row {
        flex-direction: column;
        gap: 12px;
    }
    
    .video-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .video-info-section .video-title {
        font-size: 1.1rem;
    }
    
    .video-info-section .video-meta {
        gap: 12px;
        font-size: 13px;
    }
    
    .sidebar-videos {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Player mobile adjustments */
    .ctrl-btn {
        width: 36px;
        height: 36px;
    }
    
    .ctrl-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .time-display {
        font-size: 12px;
    }
    
    .skip-btn {
        display: none;
    }
    
    .volume-control:hover .volume-slider-container {
        width: 60px;
    }
}

@media (max-width: 480px) {
    .sidebar-videos {
        grid-template-columns: 1fr;
    }
    
    .sidebar-video {
        flex-direction: row;
    }
    
    .sidebar-video .thumb {
        width: 120px;
        min-width: 120px;
    }
    
    .vote-btn {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    /* Player mobile optimized */
    .player-controls {
        padding: 20px 8px 10px;
    }
    
    .controls-row {
        gap: 0;
    }
    
    .controls-left {
        flex: 1;
        gap: 0;
    }
    
    .controls-right {
        gap: 0;
    }
    
    .ctrl-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
    }
    
    .ctrl-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .volume-control {
        display: none;
    }
    
    .speed-control {
        display: none;
    }
    
    .time-display {
        font-size: 10px;
        margin-left: 2px;
        flex-shrink: 1;
        overflow: hidden;
    }
    
    .quality-btn {
        font-size: 10px;
        padding: 0 6px;
        height: 32px;
        min-width: 40px;
    }
    
    .fullscreen-btn {
        margin-left: 0;
    }
    
    /* Progress bar more touch-friendly */
    .progress-container {
        padding: 15px 0;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .progress-handle {
        width: 18px;
        height: 18px;
        transform: translate(-50%, -50%) scale(1);
    }
    
    .preview-tooltip {
        display: none;
    }
    
    /* Quality menu mobile */
    .quality-menu {
        min-width: 80px;
        right: -10px;
    }
    
    .quality-menu button {
        padding: 10px 12px;
        font-size: 12px;
    }
}

/* ============ AUTOPLAY OVERLAY ============ */

.autoplay-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 25;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.autoplay-overlay.visible {
    opacity: 1;
    visibility: visible;
}

.autoplay-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    max-width: 400px;
    padding: 30px;
}

.autoplay-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.autoplay-label {
    color: #fff;
    font-size: 1rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.autoplay-countdown {
    position: relative;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.countdown-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.ring-bg {
    stroke: rgba(255, 255, 255, 0.2);
}

.ring-progress {
    stroke: var(--primary);
    stroke-linecap: round;
    stroke-dasharray: 100, 100;
    transition: stroke-dashoffset 1s linear;
}

.countdown-number {
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
}

.autoplay-video {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    text-decoration: none;
    transition: background 0.2s;
    width: 100%;
}

.autoplay-video:hover {
    background: rgba(255, 255, 255, 0.15);
}

.autoplay-thumb {
    position: relative;
    width: 160px;
    aspect-ratio: 16/9;
    flex-shrink: 0;
    border-radius: var(--radius);
    overflow: hidden;
}

.autoplay-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.autoplay-duration {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.autoplay-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 8px;
}

.autoplay-info h4 {
    color: #fff;
    font-size: 0.95rem;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.autoplay-meta {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
}

.autoplay-actions {
    display: flex;
    gap: 12px;
}

.autoplay-cancel,
.autoplay-now {
    padding: 10px 24px;
    border-radius: var(--radius-pill);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.autoplay-cancel {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #fff;
}

.autoplay-cancel:hover {
    border-color: #fff;
}

.autoplay-now {
    background: var(--primary);
    border: none;
    color: #fff;
}

.autoplay-now:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

.autoplay-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: background 0.2s;
}

.autoplay-toggle:hover {
    background: rgba(255, 255, 255, 0.15);
}

.toggle-label {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.85rem;
}

.toggle-switch {
    width: 36px;
    height: 20px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    position: relative;
    transition: background 0.2s;
}

.toggle-switch::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}

.toggle-switch.active {
    background: var(--primary);
}

.toggle-switch.active::after {
    transform: translateX(16px);
}

/* Mobile autoplay */
@media (max-width: 480px) {
    .autoplay-content {
        padding: 20px;
    }
    
    .autoplay-video {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .autoplay-thumb {
        width: 100%;
        max-width: 240px;
    }
    
    .autoplay-toggle {
        top: 10px;
        right: 10px;
    }
}

/* ===========================================
   ENHANCED MOBILE VIDEO PLAYER v2.0
   =========================================== */

/* Mobile video page layout */
@media (max-width: 768px) {
    .video-page-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .custom-player {
        border-radius: 0;
        margin: 0 -12px;
        width: calc(100% + 24px);
    }
    
    /* Controls show on tap/interaction */
    .player-controls {
        padding: 20px 12px 8px;
        background: linear-gradient(transparent, rgba(0,0,0,0.7));
    }
    
    /* Larger touch targets for controls */
    .ctrl-btn {
        min-width: 40px;
        min-height: 40px;
        padding: 6px;
    }
    
    .ctrl-btn svg {
        width: 22px;
        height: 22px;
    }
    
    /* Big play button - better touch target */
    .big-play-btn {
        width: 72px;
        height: 72px;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    .big-play-btn:active {
        transform: scale(0.95);
        background: var(--primary-dark);
    }
    
    .big-play-btn svg {
        width: 32px;
        height: 32px;
        margin-left: 4px;
    }
    
    /* Player overlay - ensure it captures touches */
    .player-overlay {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Progress bar - compact but touchable */
    .progress-container {
        padding: 12px 0 6px;
        margin-bottom: 2px;
    }
    
    .progress-bar {
        height: 6px;
        border-radius: 3px;
    }
    
    .progress-handle {
        width: 18px;
        height: 18px;
        transform: translate(-50%, -50%) scale(1);
    }
    
    /* Preview tooltip mobile - hide by default */
    .preview-tooltip {
        opacity: 0 !important;
        pointer-events: none;
    }
    
    .preview-tooltip.visible {
        opacity: 1 !important;
    }
    
    .preview-tooltip img {
        width: 100px;
        height: 56px;
    }
    
    .preview-tooltip .preview-time {
        font-size: 10px;
        padding: 2px 0;
    }
    
    /* Controls row - compact height */
    .controls-row {
        padding: 4px 8px 6px;
        gap: 2px;
    }
    
    .controls-left,
    .controls-right {
        gap: 0;
    }
    
    /* Play button in controls */
    .play-btn {
        min-width: 40px;
    }
    
    /* Hide skip buttons on mobile */
    .skip-btn {
        display: none;
    }
    
    /* Volume button - hide slider */
    .volume-control {
        margin-right: 2px;
    }
    
    .volume-slider-container {
        display: none !important;
    }
    
    /* Time display compact */
    .time-display {
        font-size: 0.7rem;
        min-width: auto;
        margin-left: 2px;
        color: rgba(255,255,255,0.9);
    }
    
    /* Quality/Speed compact */
    .quality-btn,
    .speed-btn {
        font-size: 0.65rem;
        padding: 4px 5px;
        min-width: auto;
        border-radius: 4px;
    }
    
    /* Fullscreen button */
    .fullscreen-btn {
        min-width: 40px;
    }
    
    /* Quality menu mobile */
    .quality-menu,
    .speed-menu {
        bottom: 45px;
        right: 8px;
        font-size: 0.85rem;
    }
    
    .quality-menu button,
    .speed-menu button {
        padding: 10px 16px;
    }
}

/* Video info section mobile */
@media (max-width: 768px) {
    .video-info-section {
        padding: 16px 12px;
    }
    
    .video-title-main {
        font-size: 1.1rem;
        line-height: 1.4;
        margin-bottom: 12px;
    }
    
    .video-actions {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .vote-btn {
        flex: 1;
        justify-content: center;
        min-width: 100px;
        padding: 12px 16px;
    }
    
    .download-btn {
        width: 100%;
        justify-content: center;
        padding: 12px;
    }
    
    .video-stats {
        flex-wrap: wrap;
        gap: 8px 16px;
        padding: 12px 0;
    }
    
    .video-stats span {
        font-size: 0.85rem;
    }
    
    .video-models a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    .video-tags {
        gap: 6px;
    }
    
    .video-tags a {
        padding: 6px 10px;
        font-size: 0.8rem;
    }
}

/* Share buttons mobile - keep them round */
@media (max-width: 768px) {
    .share-buttons {
        display: flex;
        gap: 12px;
        justify-content: flex-start;
    }
    
    .share-btn {
        width: 44px;
        height: 44px;
        border-radius: 50% !important;
        flex: none;
        min-width: auto;
    }
    
    .share-btn span {
        display: none;
    }
    
    .share-btn svg {
        width: 20px;
        height: 20px;
        margin: 0;
    }
}

/* Comments section mobile */
@media (max-width: 768px) {
    .comments-section {
        padding: 16px 12px;
        margin-top: 16px;
    }
    
    .comment-form textarea {
        padding: 12px;
        font-size: 15px;
        min-height: 80px;
    }
    
    .comment-form input {
        padding: 12px;
        font-size: 15px;
    }
    
    .comment-submit {
        width: 100%;
        padding: 14px;
        font-size: 1rem;
    }
}

/* Related videos mobile */
@media (max-width: 768px) {
    .related-videos {
        margin-top: 24px;
    }
    
    .related-videos h3 {
        font-size: 1.1rem;
        padding: 0 12px;
    }
    
    .related-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 0 12px;
    }
    
    .related-video-card {
        flex-direction: column;
    }
    
    .related-video-card .related-thumb {
        width: 100%;
        aspect-ratio: 16/9;
    }
    
    .related-video-card .related-info {
        padding: 8px;
    }
    
    .related-video-card .related-info h4 {
        font-size: 0.8rem;
        -webkit-line-clamp: 2;
    }
    
    .related-video-card .related-meta {
        font-size: 0.7rem;
    }
}

/* More videos section mobile */
@media (max-width: 768px) {
    .more-videos-section {
        padding: 16px 0;
    }
    
    .more-videos-section h2 {
        font-size: 1.1rem;
        margin-bottom: 12px;
        padding: 0 12px;
    }
}

/* Sidebar on mobile - horizontal scroll */
@media (max-width: 768px) {
    .video-sidebar {
        width: 100%;
    }
    
    .sidebar-section {
        background: var(--bg-card);
        border-radius: 0;
        margin: 0 -12px;
        padding: 16px 12px;
        border-top: 1px solid var(--border);
    }
    
    .sidebar-section h3 {
        font-size: 1rem;
    }
}

/* Fullscreen mode improvements */
.custom-player:fullscreen .controls-row,
.custom-player:-webkit-full-screen .controls-row {
    padding: 12px 20px;
}

.custom-player:fullscreen .ctrl-btn,
.custom-player:-webkit-full-screen .ctrl-btn {
    min-width: 48px;
    min-height: 48px;
}

.custom-player:fullscreen .skip-btn,
.custom-player:-webkit-full-screen .skip-btn {
    display: flex;
}

.custom-player:fullscreen .volume-slider-container,
.custom-player:-webkit-full-screen .volume-slider-container {
    display: block;
}

/* Touch feedback */
@media (hover: none) {
    .ctrl-btn:active {
        transform: scale(0.9);
        opacity: 0.8;
    }
    
    .progress-bar:active .progress-handle {
        transform: scale(1.3);
    }
    
    .big-play-btn:active {
        transform: scale(0.95);
    }
}

/* Landscape mode on mobile */
@media (max-width: 900px) and (orientation: landscape) {
    .custom-player {
        margin: 0;
        width: 100%;
        border-radius: var(--radius-lg);
    }
    
    .video-page-layout {
        gap: 16px;
    }
}

/* Safe area insets for video player */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .custom-player {
            margin-left: calc(-12px - env(safe-area-inset-left));
            margin-right: calc(-12px - env(safe-area-inset-right));
            width: calc(100% + 24px + env(safe-area-inset-left) + env(safe-area-inset-right));
        }
        
        .controls-row {
            padding-left: max(12px, env(safe-area-inset-left));
            padding-right: max(12px, env(safe-area-inset-right));
        }
    }
}
