/* Video Page Layout */
.video-page-container {
    display: grid;
    grid-template-columns: 1fr;
    min-height: 90vh;
    background: var(--bg-primary);
}

@media (min-width: 1024px) {
    .video-page-container {
        grid-template-columns: 1fr 400px;
    }
}

/* Main Video Player */
.main-video-player {
    position: relative;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
    background: var(--bg-primary);
}

/* Video.js Custom Styles */
.video-js {
    width: 100%;
    height: 100vh;
    max-height: calc(100vh - 60px);
    background: var(--bg-primary);
}

.vjs-control-bar {
    background: rgba(0, 0, 0, 0.7) !important;
    backdrop-filter: blur(10px);
}

.vjs-big-play-button {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 2px solid white !important;
    border-radius: 50% !important;
    width: 80px !important;
    height: 80px !important;
    line-height: 80px !important;
    font-size: 2.5rem !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.vjs-play-progress {
    background: var(--primary-color) !important;
}

.vjs-slider {
    background: rgba(255, 255, 255, 0.2) !important;
}

/* Video Info Overlay */
.video-info-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    z-index: 10;
    backdrop-filter: blur(2px);
}

.channel-info-overlay {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.channel-avatar-lg {
    width: 2.75rem;
    height: 2.75rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid white;
}

.channel-info-text {
    flex: 1;
}

.channel-name-lg {
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.follow-btn-overlay {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 0.375rem 1rem;
    border-radius: 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition-normal);
    white-space: nowrap;
}

.follow-btn-overlay:hover {
    background: rgba(255, 255, 255, 0.15);
}

.follow-btn-overlay.following {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.follow-btn-overlay.following:hover {
    background: var(--primary-hover);
}

.followers-count {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-top: 0.125rem;
}

/* Video Description */
.video-description-overlay {
    font-size: 0.9375rem;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    max-height: 3.75rem;
    overflow: hidden;
    transition: max-height var(--transition-normal);
}

.video-description-overlay.expanded {
    max-height: none;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0;
    margin-top: 0.25rem;
    transition: color var(--transition-fast);
}

.show-more-btn:hover {
    color: var(--text-secondary);
}

/* Video Stats */
.video-stats-overlay {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--text-tertiary);
    /*margin-top: 0.5rem;*/
    flex-wrap: wrap;
}

.video-stats-overlay span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.video-stats-overlay i {
    font-size: 0.75rem;
}

/* Action Buttons Overlay */
.action-buttons-overlay {
    position: absolute;
    right: 1.5rem;
    bottom: 120px;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    align-items: center;
    z-index: 20;
}

.action-btn-overlay {
    background: rgba(22, 24, 35, 0.6);
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-normal);
    font-size: 1.25rem;
    backdrop-filter: blur(10px);
}

.action-btn-overlay:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.action-btn-overlay:active {
    transform: scale(0.95);
}

.action-btn-overlay i {
    margin-bottom: 0.125rem;
}

.action-btn-overlay span {
    font-size: 0.75rem;
    margin-top: 0.125rem;
    font-weight: 500;
}

.like-btn-overlay.liked {
    color: var(--primary-color);
}

/* Sidebar */
.video-sidebar {
    background: var(--bg-primary);
    border-left: 1px solid var(--border-color);
    padding: 1.25rem;
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 60px;
}

@media (max-width: 1023px) {
    .video-sidebar {
        position: fixed;
        top: 0;
        /*right: -100%;*/
        width: 100%;
        /*max-width: 400px;*/
        z-index: var(--z-modal);
        transition: right var(--transition-normal);
    }
    
    .video-sidebar.active {
        right: 0;
    }
    
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: var(--z-modal-backdrop);
    }
    
    .video-sidebar.active + .sidebar-overlay {
        display: block;
    }
}

/* Sidebar Sections */
.sidebar-section {
    margin-bottom: 1.5rem;
}

.sidebar-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comments-count {
    font-size: 0.875rem;
    color: var(--text-tertiary);
    font-weight: normal;
}

/* Comments */
.comment-input-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.comment-input-avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-input-wrapper {
    flex: 1;
    position: relative;
}

.comment-input-field {
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 1.25rem;
    color: var(--text-primary);
    font-size: 0.875rem;
    outline: none;
    transition: all var(--transition-normal);
    resize: none;
    min-height: 2.5rem;
    max-height: 6rem;
    line-height: 1.4;
}

.comment-input-field:focus {
    border-color: var(--primary-color);
    background: var(--bg-hover);
}

.comment-send-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity var(--transition-fast);
}

.comment-send-btn.active {
    opacity: 1;
}

.comment-send-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color);
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.comment-content {
    flex: 1;
    min-width: 0;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.comment-username {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-primary);
}

.comment-time {
    font-size: 0.75rem;
    color: var(--text-tertiary);
}

.comment-text {
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--text-secondary);
    white-space: pre-wrap;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.comment-like-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: all var(--transition-fast);
}

.comment-like-btn:hover {
    color: var(--primary-color);
}

.comment-like-btn.active {
    color: var(--primary-color);
}

/* Related Videos */
.related-videos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-video-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.related-video-item:hover {
    background-color: var(--bg-hover);
}

.related-video-thumb {
    width: 7.5rem;
    height: 10rem;
    border-radius: 0.5rem;
    overflow: hidden;
    flex-shrink: 0;
    position: relative;
    background: var(--bg-tertiary);
}

.related-video-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.related-video-item:hover .related-video-thumb img {
    transform: scale(1.05);
}

.related-video-duration {
    position: absolute;
    bottom: 0.25rem;
    right: 0.25rem;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-size: 0.6875rem;
    font-weight: 500;
}

.related-video-info {
    flex: 1;
    min-width: 0;
}

.related-video-title {
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-video-channel {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-video-stats {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.related-video-stats span {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tags */
.video-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.tag {
    background: var(--bg-surface);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 1rem;
    font-size: 0.8125rem;
    text-decoration: none;
    transition: all var(--transition-fast);
}

.tag:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Mobile Sidebar Toggle */
.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: var(--z-fixed);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-normal);
}

.mobile-sidebar-toggle:hover {
    background: var(--primary-hover);
    transform: translateX(-50%) scale(1.1);
}

@media (max-width: 1023px) {
    .mobile-sidebar-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

/* Video Loading State */
.video-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--text-primary);
}

.video-loading-spinner {
    width: 3rem;
    height: 3rem;
    border: 0.25rem solid var(--bg-secondary);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Video Error State */
.video-error {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    padding: 2rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    max-width: 400px;
    width: 90%;
}

.video-error i {
    font-size: 3rem;
    color: var(--danger-color);
    margin-bottom: 1rem;
}

.video-error h3 {
    margin-bottom: 0.5rem;
}

.video-error p {
    color: var(--text-tertiary);
    margin-bottom: 1.5rem;
}

/* Video Controls Customization */
.video-js .vjs-volume-panel:hover .vjs-volume-control.vjs-volume-horizontal {
    width: 5rem;
}

.video-js .vjs-volume-bar {
    margin: 1.45em auto;
}

.video-js .vjs-playback-rate .vjs-playback-rate-value {
    font-size: 1rem;
    line-height: 3;
}

/* Keyboard Shortcuts Help */
.keyboard-shortcuts {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    z-index: var(--z-modal);
    box-shadow: var(--shadow-xl);
    display: none;
}

.keyboard-shortcuts.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.keyboard-shortcuts-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.keyboard-shortcuts-title {
    font-size: 1.25rem;
    font-weight: 600;
}

.close-shortcuts {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 0.25rem;
    transition: color var(--transition-fast);
}

.close-shortcuts:hover {
    color: var(--text-primary);
}

.shortcuts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.shortcut-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-surface);
    border-radius: 0.5rem;
}

.shortcut-key {
    background: var(--bg-primary);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-family: monospace;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
}

.shortcut-description {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Progress Bar Animation */
.video-js .vjs-play-progress:before {
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Quality Selector */
.vjs-quality-selector .vjs-menu-button {
    margin: 0;
    padding: 0;
}

.vjs-quality-selector .vjs-icon-placeholder:before {
    content: 'HQ';
    font-size: 0.75rem;
    line-height: 3;
}

/* Fullscreen Adjustments */
.video-js.vjs-fullscreen {
    max-height: 100vh !important;
}

/* Mobile Video Adjustments */
@media (max-width: 767px) {
    .video-js {
        height: 100vh;
    }
    
    .action-buttons-overlay {
        bottom: 100px;
        right: 1rem;
        gap: 1rem;
    }
    
    .action-btn-overlay {
        width: 2.75rem;
        height: 2.75rem;
        font-size: 1.125rem;
    }
    
    .video-info-overlay {
        padding: 1rem;
    }
    
    .channel-avatar-lg {
        width: 2.5rem;
        height: 2.5rem;
    }
    
    .follow-btn-overlay {
        padding: 0.25rem 0.75rem;
        font-size: 0.8125rem;
    }
}

/* Tablet Adjustments */
@media (min-width: 768px) and (max-width: 1023px) {
    .video-wrapper {
        max-width: 600px;
    }
    
    .action-buttons-overlay {
        right: 2rem;
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .video-js .vjs-big-play-button {
        border-width: 1px;
    }
    
    .action-btn-overlay {
        backdrop-filter: blur(20px);
    }
}

/* Print Styles */
@media print {
    .video-page-container,
    .video-js,
    .video-sidebar {
        display: none !important;
    }
    
    body::after {
        content: 'Vidado Video Page - Not printable';
        display: block;
        text-align: center;
        font-size: 2rem;
        margin-top: 3rem;
    }
}