/**
 * BJJ Video Analyzer - Common CSS Styles
 * Shared styling for video detail and analysis pages
 */

/* Modern breadcrumb styling - consistent across all pages */
.modern-breadcrumb {
    background: rgba(108, 117, 125, 0.05);
    border-bottom: 1px solid rgba(108, 117, 125, 0.1);
    padding: 0.5rem 0;
    margin-bottom: 0;
}

.modern-breadcrumb > .container:last-child {
    margin-bottom: 0 ;
}

.modern-breadcrumb .breadcrumb {
    margin-bottom: 0;
    background: none;
    padding: 0;
}

.modern-breadcrumb .breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modern-breadcrumb .breadcrumb-item a:hover {
    color: #495057;
    text-decoration: underline;
}

.modern-breadcrumb .breadcrumb-item.active {
    color: #6c757d;
    font-weight: 500;
}

.modern-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: #6c757d;
    font-weight: 600;
}

/* Base styles for BJJ Video components */

/* Fix dropdown z-index issues */
.dropdown-menu {
    z-index: 1050 !important;
    position: absolute !important;
}

.btn-group .dropdown-menu {
    z-index: 1051 !important;
}

/* Ensure modals and other Bootstrap components have proper z-index hierarchy */
.modal {
    z-index: 1055 !important;
}

.modal-backdrop {
    z-index: 1054 !important;
}

/* Video player should not interfere with dropdowns */
video {
    position: relative;
    z-index: 1;
}

/* Technique highlight styling */
.technique-highlight {
    background-color: rgba(102, 16, 242, 0.1);
    border-bottom: 1px dashed #6610f2;
    border-radius: 2px;
    padding: 0 2px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.technique-highlight:hover {
    background-color: rgba(102, 16, 242, 0.2);
}

/* Position highlight styling - green */
.position-highlight {
    background-color: rgba(25, 135, 84, 0.1);
    border-bottom: 1px dashed #198754;
    border-radius: 2px;
    padding: 0 2px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.position-highlight:hover {
    background-color: rgba(25, 135, 84, 0.2);
}

/* Mechanic highlight styling - grey */
.mechanic-highlight {
    background-color: rgba(108, 117, 125, 0.1);
    border-bottom: 1px dashed #6c757d;
    border-radius: 2px;
    padding: 0 2px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.mechanic-highlight:hover {
    background-color: rgba(108, 117, 125, 0.2);
}

/* WebVTT Styling */
::cue(.technique) {
    background: rgba(102, 16, 242, 0.2);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

::cue(.position) {
    background: rgba(25, 135, 84, 0.2);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

::cue(.mechanic) {
    background: rgba(108, 117, 125, 0.2);
    color: white;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.8);
}

/* Select2 styles for technique dropdown */
.select2-container--bootstrap-5 .select2-selection {
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    border-radius: 0.25rem;
}

.select2-container--bootstrap-5 .select2-selection--single {
    height: calc(1.5em + 0.75rem + 2px);
}

.select2-container--bootstrap-5 .select2-selection__rendered {
    color: #212529;
    line-height: 1.5;
}

.select2-container--bootstrap-5 .select2-selection__arrow {
    height: calc(1.5em + 0.75rem);
}

.select2-container--bootstrap-5 .select2-results__option--highlighted[aria-selected] {
    background-color: #0d6efd;
    color: white;
}

.select2-container--bootstrap-5 .select2-search--dropdown .select2-search__field {
    padding: 0.375rem 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.25rem;
}

.select2-container--bootstrap-5 .select2-dropdown {
    border-color: #ced4da;
    border-radius: 0.25rem;
}

.select2-container--bootstrap-5.select2-container--focus .select2-selection {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Formatted content styles */
.formatted-content {
    line-height: 1.6;
}

.formatted-content p {
    margin-bottom: 1rem;
}

.formatted-content ul, 
.formatted-content ol,
.formatted-list {
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.formatted-content li,
.formatted-list li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.formatted-content ul li,
.formatted-list li {
    list-style-type: disc;
}

.formatted-content ol li {
    list-style-type: decimal;
}

/* Responsive video actions */
@media (max-width: 768px) {
    .d-flex.justify-content-between.align-items-start {
        flex-direction: column;
        align-items: stretch !important;
    }
    
    .btn-group {
        margin-top: 1rem;
        align-self: flex-end;
    }
    
    .btn-group .btn {
        font-size: 0.875rem;
    }
}

/* Technique links styling */
.technique-link {
    color: #0d6efd;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}
.technique-link:hover {
    text-decoration: underline;
}
.technique-link i {
    margin-left: 0.25rem;
    font-size: 0.85em;
}

/* Timestamp badge styling */
.badge[title="Click to jump to this timestamp"] {
    transition: all 0.2s ease;
    position: relative;
}

.badge[title="Click to jump to this timestamp"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.badge[title="Click to jump to this timestamp"]::after {
    content: ' ▶';
    font-size: 0.7em;
    vertical-align: middle;
    opacity: 0.7;
}

/* Video analysis specific styles */
.transcript-segment {
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.transcript-segment:hover {
    background-color: rgba(0,0,0,0.05);
}

.current-segment {
    background-color: rgba(0,123,255,0.1);
    border-left: 3px solid #007bff;
}

/* Frame timeline styling */
.frame-timeline-container {
    position: relative;
    height: 160px;
    margin-bottom: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.frame-timeline {
    display: flex;
    height: 120px;
    align-items: flex-end;
    padding: 0 10px;
    overflow-x: auto;
    gap: 1px;
}

.frame-marker {
    width: 5px;
    min-width: 5px;
    background-color: #0d6efd;
    border-radius: 2px 2px 0 0;
    transition: all 0.2s;
    cursor: pointer;
}

.frame-marker:hover {
    background-color: #0a58ca;
    transform: scaleY(1.05);
}

.frame-marker.frame-selected {
    background-color: #dc3545;
    transform: scaleY(1.1);
}

.frame-timeline-labels {
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    font-size: 12px;
    color: #6c757d;
}

.key-frame-card {
    margin-bottom: 15px;
    transition: all 0.3s;
    border: 1px solid #dee2e6;
}

.key-frame-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

/* Tooltip styling */
.tooltip {
    --bs-tooltip-max-width: 300px;
    --bs-tooltip-bg: rgba(0, 0, 0, 0.85);
    --bs-tooltip-padding-x: 0.8rem;
    --bs-tooltip-padding-y: 0.5rem;
}

.bi-info-circle {
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.bi-info-circle:hover {
    opacity: 1;
}

/* Consistent tab navigation styling across all pages */
.nav-tabs {
    border-bottom: 2px solid #e9ecef !important;
    background: #f8f9fa !important;
    padding: 0 1.5rem !important;
}

.nav-tabs .nav-link {
    border: none !important;
    border-radius: 0 !important;
    font-weight: 600 !important;
    color: #6c757d !important;
    padding: 1rem 1.5rem !important;
    position: relative;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #0d6efd !important;
    background: transparent !important;
    border-color: transparent !important;
}

.nav-tabs .nav-link.active {
    color: #0d6efd !important;
    background: transparent !important;
    border-color: transparent !important;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(135deg, #0d6efd 0%, #6610f2 100%);
    border-radius: 2px 2px 0 0;
}