/* Video Detail Page Styles - 40/60 Layout */

/* Video Player Section (40%) */
.video-player-section {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Portrait player sizing for TikTok videos */
.tiktok-video-container-detail {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

.tiktok-video-container-detail video {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 9 / 16;
    object-fit: cover;
}

.video-wrapper,
.tiktok-video-container-detail {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
}

.player {
    position: relative;
    background: #000;
    max-height: 85vh;
    overflow: hidden;
}

.player video {
    max-height: 85vh !important;
    width: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Insights Panel (60%) */
.insights-panel {
    background: #fff;
}

.insights-panel .card {
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
}

.insights-panel .card-header {
    background: #f8f9fa;
    border-bottom: 2px solid #e9ecef;
    padding: 16px 20px;
}

.insights-panel .card-header.bg-primary {
    background: #0d6efd !important;
    border-bottom: none;
}

.insights-panel .card-header h5,
.insights-panel .card-header h6 {
    margin: 0;
    font-weight: 600;
}

.insights-panel .card-body {
    padding: 20px;
}

/* Quick Actions Bar */
.quick-actions-bar {
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 24px;
}

.quick-actions-bar .btn {
    font-weight: 600;
    padding: 10px 20px;
}

/* Guardrails for layout */
.row.g-4 > * {
    min-width: 0 !important;
}

.row.g-4 video,
.row.g-4 .video-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

/* Mobile engagement bar */
@media (max-width: 991.98px) {
    .engagement-bar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: white;
        border-top: 1px solid #dee2e6;
        padding: 1rem;
        z-index: 1020;
        justify-content: space-around;
    }

    .engagement-bar .btn {
        flex: 1;
        max-width: 80px;
        font-size: 0.8rem;
    }

    .engagement-bar .btn span {
        display: none;
    }

    .container {
        padding-bottom: 10px;
    }
}

/* Expandable sections */
.expandable-section button[data-bs-toggle="collapse"] .bi-chevron-down {
    transition: transform 0.2s ease;
}

.expandable-section button[data-bs-toggle="collapse"][aria-expanded="true"] .bi-chevron-down {
    transform: rotate(180deg);
}

/* TikTok layout container - side by side */
.tiktok-layout-container {
    display: flex;
    align-items: center;
    gap: 20px;
    max-width: fit-content;
    margin: 0 auto;
}

/* TikTok-style vertical engagement sidebar */
.tiktok-engagement-sidebar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: center;
    padding: 16px 8px;
    background: linear-gradient(180deg, 
        rgba(0, 0, 0, 0.1) 0%, 
        rgba(0, 0, 0, 0.3) 50%, 
        rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(12px) saturate(180%);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.2);
    min-height: 400px;
    justify-content: center;
}

.tiktok-engagement-btn {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.15);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.25) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(255, 255, 255, 0.05) 100%);
    color: white;
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.tiktok-engagement-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tiktok-engagement-btn:hover {
    transform: scale(1.08) translateY(-2px);
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.35) 0%, 
        rgba(255, 255, 255, 0.2) 50%, 
        rgba(255, 255, 255, 0.15) 100%);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                0 0 20px rgba(255, 255, 255, 0.1);
    color: white;
}

.tiktok-engagement-btn:hover::before {
    opacity: 1;
}

.tiktok-engagement-btn:active {
    transform: scale(1.02) translateY(0px);
    transition: all 0.1s ease;
}

.tiktok-engagement-btn.like-btn:hover {
    background: linear-gradient(135deg, 
        rgba(255, 20, 147, 0.4) 0%, 
        rgba(255, 20, 147, 0.25) 50%, 
        rgba(255, 20, 147, 0.15) 100%);
    box-shadow: 0 6px 24px rgba(255, 20, 147, 0.3),
                inset 0 1px 0 rgba(255, 255, 255, 0.4),
                0 0 20px rgba(255, 20, 147, 0.2);
}

.tiktok-engagement-btn.danger-btn {
    background: linear-gradient(135deg, 
        rgba(220, 53, 69, 0.8) 0%, 
        rgba(220, 53, 69, 0.6) 50%, 
        rgba(220, 53, 69, 0.5) 100%);
    border-color: rgba(220, 53, 69, 0.3);
}

.tiktok-engagement-btn.danger-btn:hover {
    background: linear-gradient(135deg, 
        rgba(220, 53, 69, 0.9) 0%, 
        rgba(220, 53, 69, 0.7) 50%, 
        rgba(220, 53, 69, 0.6) 100%);
    box-shadow: 0 6px 24px rgba(220, 53, 69, 0.4),
                inset 0 1px 0 rgba(255, 255, 255, 0.3),
                0 0 20px rgba(220, 53, 69, 0.3);
}

.tiktok-engagement-count {
    font-size: 0.7rem;
    color: white;
    text-align: center;
    margin-top: 4px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    letter-spacing: 0.3px;
    line-height: 1;
    min-height: 12px;
    opacity: 0.95;
}

/* TikTok video container positioning */
.tiktok-video-container {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 360px;
    aspect-ratio: 9/16;
    height: auto;
}

/* Responsive TikTok video sizing */
.tiktok-video-container .player {
    width: 100% !important;
    height: 100% !important;
    max-width: 360px;
    max-height: 640px;
}

/* Hide traditional engagement bar for TikTok videos */
.tiktok-video .engagement-bar {
    display: none;
}

/* Responsive TikTok layout for mobile */
@media (max-width: 768px) {
    .tiktok-layout-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .tiktok-engagement-sidebar {
        flex-direction: row;
        min-height: auto;
        padding: 12px 16px;
        gap: 12px;
        justify-content: space-around;
        max-width: 100%;
        overflow-x: auto;
    }
    
    .tiktok-engagement-btn {
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    .tiktok-engagement-count {
        font-size: 0.65rem;
        margin-top: 2px;
    }
}

/* Responsive adjustments for TikTok layout */
@media (max-width: 768px) {
    .tiktok-engagement-overlay {
        right: 10px;
        bottom: 60px;
        gap: 15px;
    }
    
    .tiktok-engagement-btn {
        width: 44px;
        height: 44px;
        font-size: 1.1rem;
    }
    
    .tiktok-engagement-count {
        font-size: 0.7rem;
    }
}

@media (max-width: 480px) {
    .tiktok-engagement-overlay {
        right: 8px;
        bottom: 50px;
        gap: 12px;
    }
    
    .tiktok-engagement-btn {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
}

/* Responsive video sizing for mobile */
@media (max-width: 768px) {
    .video-hero-section {
        max-height: 60vh;
    }

    .video-hero-section .player {
        max-height: 60vh !important;
        height: 60vh !important;
    }

    .video-hero-section video {
        max-height: 60vh !important;
        height: 60vh !important;
    }
}

/* ===== MOVED FROM INLINE TEMPLATE FOR PERFORMANCE ===== */

/* Guardrails for responsive layout */
.row.g-4 > * {
    min-width: 0 !important; /* Prevent overflow from breaking columns */
}

.row.g-4 video,
.row.g-4 .video-wrapper {
    width: 100% !important;
    max-width: 100% !important;
}

/* Import browse page video card styles */
.video-card {
    height: 100%;
    transition: all 0.2s ease;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
}

/* Creator Mode Voice Profile Cards */
.voice-profile-card {
    transition: all 0.2s;
}

.voice-profile-card:hover {
    background-color: #f8f9fa;
    border-color: #0d6efd !important;
}

.voice-profile-card input:checked ~ label {
    color: #0d6efd;
}

.voice-profile-card input:checked {
    border-color: #0d6efd;
    background-color: #0d6efd;
}

.video-thumbnail-container {
    position: relative;
    overflow: hidden;
    border-radius: 12px 12px 0 0;
}

.inline-video-player {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 8px 8px 0 0 !important;
    background: #000 !important;
    z-index: 50 !important;
}

.thumbnail-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
}

.landscape-ratio {
    padding-bottom: 56.25%; /* 16:9 */
}

.portrait-ratio {
    padding-bottom: 177.78%; /* 9:16 */
    max-height: 600px;
}

.platform-badge {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 4px;
    border: none;
}

.tiktok-badge {
    background: rgba(255, 0, 80, 0.9);
    color: white;
}

.youtube-badge {
    background: rgba(255, 0, 0, 0.9);
    color: white;
}

.instagram-badge {
    background: rgba(228, 64, 95, 0.9);
    color: white;
}

.vimeo-badge {
    background: rgba(26, 183, 234, 0.9);
    color: white;
}

.default-badge {
    background: rgba(108, 117, 125, 0.9);
    color: white;
}

.card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 140px;
    background-color: #ffffff;
}

.line-clamp-1 {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.video-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
    color: #1a1a1a;
}

.transcript-excerpt {
    font-size: 14px;
    line-height: 1.4;
    color: #666;
    margin: 0;
}

.metadata-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 8px 0;
}

.metadata-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #888;
}

.metadata-item i {
    font-size: 11px;
}