/**
 * Watch Page Styles
 * Complete layout with sidebar, breadcrumbs, author box, and CTA
 */

/* Breadcrumbs */
.watch-breadcrumbs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 20px 0;
}

.watch-breadcrumbs .bg-breadcrumbs ul {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 14px;
    color: #64748b;
}

.watch-breadcrumbs .bg-breadcrumbs li {
    display: flex;
    align-items: center;
}

.watch-breadcrumbs .bg-breadcrumbs a {
    color: #64748b;
    text-decoration: none;
}

.watch-breadcrumbs .bg-breadcrumbs a:hover {
    color: #3b82f6;
}

.watch-breadcrumbs .bg-breadcrumbs li.current {
    color: #1e293b;
}

/* Main Container */
.watch-page {
    padding: 30px 0 60px;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
}

.watch-page-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 60px;
    align-items: start;
}

.watch-main-column {
    width: 100%;
    max-width: 100%;
    overflow: hidden; /* Contain slider overflow */
}

.watch-video-player {
    margin-bottom: 30px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: relative;
}

.video-embed-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-embed-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-placeholder {
    aspect-ratio: 16 / 9;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 18px;
}

.watch-video-player .cmplz-placeholder-1 {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding-bottom: 0 !important;
}

.watch-video-player .cmplz-placeholder-1 img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.watch-video-player .cmplz-placeholder-element-inner {
    position: absolute !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 10 !important;
}

/* Video Title */
.watch-title {
    font-size: 48px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    color: #000000;
    letter-spacing: -0.02em;
}

/* Video Excerpt */
.watch-excerpt {
    font-size: 18px;
    line-height: 1.6;
    color: #64748b;
    margin-bottom: 40px;
}

.watch-excerpt p {
    margin: 0;
}

/* Video Chapters Box */
.watch-chapters {
    margin-bottom: 50px;
    padding: 40px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.chapters-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 30px 0;
    color: #000000;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chapters-icon {
    width: 20px;
    height: 20px;
    color: #3b82f6;
}

.chapters-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

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

.chapter-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
}

.chapter-title {
    flex: 1;
    color: #1e293b;
    font-size: 15px;
    line-height: 1.5;
}

.chapter-timestamp {
    color: #64748b;
    font-size: 14px;
    font-family: 'Courier New', Courier, monospace;
    white-space: nowrap;
    font-weight: 500;
}

/* Post Content */
.watch-content {
    font-size: 16px;
    line-height: 1.8;
    color: #475569;
    margin-bottom: 60px;
}

.watch-content p {
    margin-bottom: 20px;
}

.watch-content h2 {
    font-size: 32px;
    font-weight: 700;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #1e293b;
}

.watch-content h3 {
    font-size: 24px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 16px;
    color: #1e293b;
}

.watch-read-more-btn {
    background: none;
    border: none;
    color: #243DF6;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.watch-read-more-btn:hover {
    text-decoration: underline;
}

/* Author Box */
.watch-page .watch-full-width-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.watch-page .watch-full-width-section .author-box {
    margin-bottom: 60px;
}

/* CTA Banner Section */
.watch-page .watch-full-width-section.author-cta {
    margin-bottom: 0;
}

.watch-page .watch-full-width-section .content-container {
    padding: 0;
}

/* More from Category Section (In Sidebar) */
.watch-more-from-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #e2e8f0;
}

/* Mobile Watch Next Slider */
.watch-next-mobile {
    display: none; /* Hidden on desktop */
    margin-bottom: 40px;
    width: 100%;
    max-width: 100%;
}

.mobile-watch-next-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #000000;
}

.watch-next-slider {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    width: 100%;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 #f1f5f9;
}

.watch-next-slider::-webkit-scrollbar {
    height: 8px;
}

.watch-next-slider::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.watch-next-slider::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.watch-next-slider::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.watch-next-slide {
    flex: 0 0 280px;
    scroll-snap-align: start;
}

.watch-next-slide-link {
    display: block;
    text-decoration: none;
    color: inherit;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.watch-next-slide-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.watch-next-slide-thumbnail {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.watch-next-slide-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.watch-next-slide-link:hover .watch-next-slide-thumbnail img {
    transform: scale(1.05);
}

.watch-next-slide-info {
    padding: 15px;
}

.watch-next-slide-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 8px 0;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-next-slide-category {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.watch-next-section {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    padding: 20px;
    color: #000000;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.watch-next-list {
    display: flex;
    flex-direction: column;
    max-height: 594px;
    overflow-y: auto;
}

.watch-next-list::-webkit-scrollbar {
    width: 4px;
}

.watch-next-list::-webkit-scrollbar-track {
    background: transparent;
}

.watch-next-list::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.watch-next-list::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.watch-next-item {
    border-bottom: 1px solid #e2e8f0;
    transition: background 0.2s ease;
}

.watch-next-item:last-child {
    border-bottom: none;
}

.watch-next-item:hover {
    background: #f8fafc;
}

.watch-next-link {
    display: flex;
    gap: 15px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.watch-next-thumbnail {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 16 / 9;
    background: #f1f5f9;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.watch-next-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.watch-next-item:hover .watch-next-thumbnail img {
    transform: scale(1.05);
}

/* Video Duration Badge */
.video-duration-badge {
    position: absolute;
    bottom: 4px;
    right: 4px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    line-height: 1.4;
    z-index: 1;
    letter-spacing: 0.3px;
}

.watch-next-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
}

.watch-next-title {
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.4;
    margin: 0;
    color: #1e293b;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.watch-next-category {
    font-size: 12px !important;
    color: #94a3b8;
    margin: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .watch-page-wrapper {
        grid-template-columns: 1fr;
        gap: 40px;
    }
    
    /* Hide sidebar on tablet/mobile */
    .watch-sidebar {
        display: none;
    }
    
    /* Show mobile slider on tablet/mobile */
    .watch-next-mobile {
        display: block;
    }
}

@media (max-width: 768px) {
    .watch-breadcrumbs {
        padding: 15px 15px 0;
    }
    
    .watch-page {
        padding: 20px 0 40px;
    }
    
    .watch-page-wrapper {
        padding: 0 15px;
        max-width: 100vw;
        box-sizing: border-box;
    }
    
    .watch-main-column {
        width: 100%;
        max-width: 100%;
    }
    
    .watch-title {
        font-size: 32px;
        margin-bottom: 15px;
    }
    
    .watch-excerpt {
        font-size: 16px;
        margin-bottom: 30px;
    }
    
    .watch-chapters {
        padding: 25px 20px;
        margin-bottom: 35px;
    }
    
    .chapters-title {
        font-size: 16px;
        margin-bottom: 20px;
    }
    
    .chapters-list {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .chapters-column {
        gap: 15px;
    }
    
    .chapter-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .chapter-title {
        font-size: 14px;
    }
    
    .chapter-timestamp {
        font-size: 13px;
    }
    
    .watch-content {
        font-size: 15px;
        line-height: 1.7;
        margin-bottom: 40px;
    }
    
    .watch-page .watch-full-width-section {
        padding: 0 15px;
    }
    
    .watch-page .watch-full-width-section .author-box {
        margin-bottom: 40px;
    }
    
    .watch-page .watch-full-width-section.author-cta {
        margin-bottom: 0;
    }
    
    .watch-next-mobile {
        margin-bottom: 30px;
    }
    
    .mobile-watch-next-title {
        font-size: 18px;
        margin-bottom: 15px;
    }
    
    .watch-next-slider {
        gap: 15px;
    }
    
    .watch-next-slide {
        flex: 0 0 70%;
        max-width: 70%;
    }
    
    .watch-next-slide-info {
        padding: 12px;
    }
    
    .watch-next-slide-title {
        font-size: 14px;
    }
    
    .watch-next-slide-category {
        font-size: 12px;
    }
}

/* Admin styles for meta boxes */
.watch-chapter-item {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.watch-chapters-list {
    margin-bottom: 15px;
}

.watch-add-chapter {
    margin-top: 10px;
}

.watch-remove-chapter {
    background: #dc3545;
    color: #fff;
    border: none;
    padding: 5px 12px;
    cursor: pointer;
    border-radius: 3px;
}

.watch-remove-chapter:hover {
    background: #c82333;
}
