/* Custom styles for Dropbotix - Dark Theme Fixes */

/* =================== MODERN TIMELINE INTEGRATION =================== */
/* Integration with modern timeline UI system */

/* Enhanced timeline clips with modern styling */
.timeline-clip.modern-clip {
    transition: all 0.25s cubic-bezier(0.4, 0.0, 0.2, 1);
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    transform: translateZ(0);
    will-change: transform, box-shadow;
}

.timeline-clip.modern-clip:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

/* Touch and mobile enhancements */
@media (max-width: 768px) {
    .timeline-clip {
        min-height: 44px !important;
        padding: 8px 12px !important;
        margin: 3px !important;
    }
    
    .timeline-layer-header {
        min-height: 44px !important;
        padding: 12px !important;
    }
    
    .clip-control-btn {
        width: 24px !important;
        height: 24px !important;
        font-size: 12px !important;
    }
}

/* Modern tooltips integration */
.rich-tooltip {
    position: fixed;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 12px;
    z-index: 10000;
    pointer-events: none;
    backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 300px;
}

.rich-tooltip .tooltip-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 8px;
    margin-bottom: 8px;
}

.rich-tooltip .tooltip-title {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 2px;
}

.rich-tooltip .tooltip-type {
    font-size: 10px;
    color: #999;
    text-transform: uppercase;
}

.rich-tooltip .tooltip-metadata {
    font-size: 11px;
}

.rich-tooltip .metadata-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.rich-tooltip .metadata-row .label {
    color: #ccc;
}

.rich-tooltip .metadata-row .value {
    color: #fff;
    font-weight: 500;
}

/* AI suggestion panels */
.ai-suggestion-panel {
    position: fixed;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border: 1px solid #28a745;
    border-radius: 12px;
    padding: 16px;
    z-index: 10001;
    min-width: 300px;
    max-width: 400px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.ai-suggestion-panel .suggestion-header {
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(40, 167, 69, 0.3);
}

.ai-suggestion-panel .suggestion-item {
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
}

.ai-suggestion-panel .suggestion-title {
    font-size: 13px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 4px;
}

.ai-suggestion-panel .suggestion-description {
    font-size: 12px;
    color: #ecf0f1;
    margin-bottom: 8px;
    line-height: 1.4;
}

.ai-suggestion-panel .suggestion-actions {
    display: flex;
    gap: 8px;
}

.ai-suggestion-panel .suggestion-btn {
    padding: 4px 12px;
    border: none;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ai-suggestion-panel .suggestion-btn.accept {
    background: #28a745;
    color: white;
}

.ai-suggestion-panel .suggestion-btn.accept:hover {
    background: #20c997;
}

.ai-suggestion-panel .suggestion-btn.dismiss {
    background: #6c757d;
    color: white;
}

.ai-suggestion-panel .suggestion-btn.dismiss:hover {
    background: #5a6268;
}

/* Touch context menu */
.touch-context-menu {
    position: fixed;
    background: #2c3e50;
    border: 1px solid #34495e;
    border-radius: 8px;
    padding: 8px 0;
    z-index: 10002;
    min-width: 120px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
}

.touch-context-menu button {
    display: block;
    width: 100%;
    padding: 12px 16px;
    border: none;
    background: none;
    color: #ecf0f1;
    text-align: left;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    min-height: 44px; /* Touch-friendly */
}

.touch-context-menu button:hover {
    background: #34495e;
    color: #ffffff;
}

/* Timeline snap guides */
.timeline-snap-guide {
    position: absolute;
    width: 2px;
    background: #00ff88;
    box-shadow: 0 0 4px #00ff88;
    z-index: 200;
    opacity: 0;
    transition: opacity 0.2s ease;
    top: 0;
    bottom: 0;
}

.timeline-snap-guide.active {
    opacity: 1;
    animation: snap-pulse 0.3s ease;
}

@keyframes snap-pulse {
    0% { transform: scaleX(1); }
    50% { transform: scaleX(1.5); }
    100% { transform: scaleX(1); }
}

/* Performance optimizations */
.timeline-clip.virtualized {
    opacity: 0.7;
    transform: scale(0.98);
    filter: grayscale(20%);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .timeline-clip {
        border-width: 2px !important;
    }
    
    .ai-suggestion-panel {
        border-width: 2px;
        box-shadow: 0 0 0 1px #28a745;
    }
    
    .rich-tooltip {
        border-width: 2px;
        background: #000000;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .timeline-clip,
    .ai-suggestion-panel,
    .rich-tooltip,
    .touch-context-menu {
        transition: none !important;
        animation: none !important;
    }
    
    .timeline-clip:hover {
        transform: none !important;
    }
}

/* Integration with existing audio styles */

/* Audio Layer CSS Styles */
.audio-clip {
    background: linear-gradient(135deg, #e74c3c, #c0392b) !important;
    border: 1px solid #e74c3c !important;
    position: relative;
}

.audio-clip.selected {
    border: 2px solid #f39c12 !important;
    box-shadow: 0 0 10px rgba(243, 156, 18, 0.5) !important;
}

.audio-clip.muted {
    opacity: 0.5 !important;
    filter: grayscale(50%) !important;
}

.waveform-container {
    position: relative;
    background: #0a0a0a;
    border: 1px solid #333;
    border-radius: 4px;
}

.waveform-container canvas {
    display: block;
    width: 100%;
    cursor: crosshair;
}

.audio-dropzone {
    border: 2px dashed #666;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    background: #1a1a1a;
    cursor: pointer;
    transition: all 0.3s ease;
}

.audio-dropzone:hover {
    border-color: #28a745;
    background: #1e2a1e;
}

.audio-dropzone.dragover {
    border-color: #28a745;
    background: #1e2a1e;
    transform: scale(1.02);
}

.analysis-meter {
    margin-bottom: 8px;
}

.analysis-meter .progress {
    height: 8px;
    background-color: #2c2c2c;
}

.analysis-meter .progress-bar {
    transition: width 0.3s ease;
}

#eqSection.enabled {
    background: rgba(40, 167, 69, 0.1);
    border-radius: 4px;
    padding: 8px;
}

#reverbSection.enabled {
    background: rgba(23, 162, 184, 0.1);
    border-radius: 4px;
    padding: 8px;
}

.audio-clip-context-menu {
    position: fixed;
    background: #2c3e50;
    border: 1px solid #34495e;
    border-radius: 4px;
    padding: 4px 0;
    z-index: 10000;
    min-width: 150px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.clip-context-menu-item {
    display: block;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: none;
    color: #ecf0f1;
    text-align: left;
    cursor: pointer;
    font-size: 12px;
    transition: background-color 0.2s;
}

.clip-context-menu-item:hover {
    background: #34495e;
    color: #ffffff;
}

.clip-context-menu-item i {
    width: 16px;
    margin-right: 8px;
}

#audioRecordButton.recording {
    background: #dc3545 !important;
    animation: recording-pulse 1s ease-in-out infinite alternate;
}

@keyframes recording-pulse {
    from { opacity: 1; }
    to { opacity: 0.6; }
}

.progress-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #28a745;
    font-size: 14px;
    font-weight: 500;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

/* Timeline Layer 4 Audio Styling */
.timeline-layer[data-layer="4"] {
    background: #1a1a1a;
}

.timeline-layer[data-layer="4"] .timeline-clip {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    border-color: #e74c3c;
}

.timeline-layer[data-layer="4"] .timeline-clip:hover {
    background: linear-gradient(135deg, #f56c6c, #e74c3c);
    transform: translateY(-2px);
}

/* Audio level meters */
.level-meter {
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
    margin: 2px 0;
}

.level-meter-bar {
    height: 100%;
    background: linear-gradient(to right, #28a745, #ffc107, #dc3545);
    width: 0%;
    transition: width 0.1s ease;
}

/* Waveform zoom controls */
.waveform-zoom-controls {
    display: flex;
    gap: 4px;
    margin-bottom: 8px;
}

.waveform-zoom-controls button {
    padding: 4px 8px;
    font-size: 10px;
}

/* HD Variants Styling */
.hd-variants {
    margin-top: 0.5rem;
}

.hd-variants-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.hd-variant {
    padding: 0.25rem 0.5rem;
    background: linear-gradient(135deg, #495057, #6c757d);
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    display: inline-flex;
    align-items: center;
    user-select: none;
}

.hd-variant:hover {
    background: linear-gradient(135deg, #17a2b8, #20c997);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,123,255,0.3);
    border-color: #17a2b8;
}

.hd-variant-small {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem;
    background: transparent;
    border: none;
    cursor: pointer;
}

.hd-variant-thumbnail {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid rgba(255,255,255,0.2);
}

.hd-variant-small:hover .hd-variant-thumbnail {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,123,255,0.4);
    border-color: #17a2b8;
}

.hd-variant-label {
    color: #adb5bd;
    font-size: 0.7rem;
    font-weight: 500;
    text-align: center;
}

.hd-variants-label small {
    font-weight: 500;
    color: #adb5bd !important;
}

/* Scene Images Scrollable List Styles */
.scene-images-scroll {
    background-color: #0d1117 !important;
    border: 1px solid #21262d !important;
    border-radius: 8px !important;
}

.scene-images-scroll::-webkit-scrollbar {
    width: 8px;
}

.scene-images-scroll::-webkit-scrollbar-track {
    background: #161b22;
    border-radius: 4px;
}

.scene-images-scroll::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 4px;
}

.scene-images-scroll::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

.scene-image-item {
    transition: all 0.2s ease;
}

.scene-image-item .card {
    transition: all 0.2s ease;
    cursor: pointer;
}

.scene-image-item .card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.scene-image-item .card.border-success {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.scene-image-item .card.border-warning {
    border-color: #ffc107 !important;
}

.scene-image-item .card.border-danger {
    border-color: #dc3545 !important;
}

.scene-image-item .spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

.bg-darker {
    background-color: #0d1117 !important;
}

/* Image Loading Prevention */
.rounded-circle {
    min-width: 32px;
    min-height: 32px;
    background-color: #6c757d;
    transition: all 0.3s ease;
}

.rounded-circle img {
    transition: opacity 0.3s ease;
}

.rounded-circle img[src=""], .rounded-circle img:not([src]) {
    opacity: 0;
    display: none;
}

/* Darker Background Theme */
body {
    background-color: #0d1117 !important; /* Much darker background */
    color: #e6edf3 !important; /* Light text */
    font-size: 14px !important; /* Reduced from 16px */
}

html {
    font-size: 14px !important; /* Reduced from 16px */
    background-color: #0d1117 !important; /* Match body background */
}

/* Card backgrounds darker */
.card {
    background-color: #000000 !important; /* Pure black background for scene images */
    border-color: #21262d !important; /* Darker border */
}

/* Scene image containers - force black backgrounds */
.scene-images-display {
    background-color: #000000 !important;
}

.image-item {
    background-color: #000000 !important;
}

/* Ensure images are visible and not hidden by CSS - 3x larger size */
.img-thumbnail {
    border: 2px solid #28a745 !important;
    background-color: #f8f9fa !important;
    padding: 4px !important;
    max-width: 450px !important;
    max-height: 450px !important;
    width: auto !important;
    height: auto !important;
}

.clickable-image {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    position: relative !important;
    z-index: 10 !important;
}

/* Fix any potential hiding from parent containers */
.image-item {
    background-color: #000000 !important;
    display: block !important;
    visibility: visible !important;
}

/* Scene image containers - ensure visibility */
.scene-images-display,
.images-container,
#images-0, #images-1, #images-2, #images-3, #images-4, #images-5 {
    display: block !important;
    visibility: visible !important;
    min-height: 200px !important;
}

/* Upscaled variants styling */
.upscaled-variants {
    border-color: #495057 !important;
    background-color: #1c1c1c !important;
}

.variant-thumb {
    transition: all 0.3s ease;
    border-radius: 8px !important;
}

.variant-thumb:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 8px rgba(40, 167, 69, 0.4) !important;
    border-color: #28a745 !important;
}

.selected-variant {
    border-color: #28a745 !important;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.3) !important;
}

.variant-thumb img {
    transition: opacity 0.3s ease;
}

.variant-thumb:hover img {
    opacity: 0.9;
}

.images-container {
    background-color: #000000 !important;
}

.card-header {
    background-color: #1c2128 !important; /* Slightly lighter header */
    border-bottom-color: #21262d !important;
}

/* Navbar darker */
.navbar {
    background-color: #010409 !important; /* Very dark navbar */
}

/* Sidebar darker */
.sidebar {
    background-color: #0d1117 !important; /* Match body background */
}

/* Form controls darker */
.form-control, .form-select {
    background-color: #21262d !important; /* Dark input background */
    border-color: #30363d !important; /* Darker border */
    color: #e6edf3 !important; /* Light text */
}

.form-control:focus, .form-select:focus {
    background-color: #21262d !important;
    border-color: #388bfd !important; /* Blue focus border */
    color: #e6edf3 !important;
    box-shadow: 0 0 0 0.25rem rgba(56, 139, 253, 0.25) !important;
}

/* Table darker */
.table {
    --bs-table-bg: #0d1117 !important; /* Dark table background */
    --bs-table-striped-bg: #161b22 !important; /* Dark striped rows */
    color: #e6edf3 !important; /* Light text */
}

.table-dark {
    --bs-table-bg: #161b22 !important;
    --bs-table-striped-bg: #1c2128 !important;
}

/* Modal darker */
.modal-content {
    background-color: #161b22 !important; /* Dark modal background */
    border-color: #21262d !important;
}

.modal-header {
    background-color: #1c2128 !important;
    border-bottom-color: #21262d !important;
}

/* Dropdown darker */
.dropdown-menu {
    background-color: #161b22 !important; /* Dark dropdown */
    border-color: #21262d !important;
}

.dropdown-item {
    color: #e6edf3 !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #21262d !important;
    color: #e6edf3 !important;
}

/* Main content areas darker */
.main-content, .admin_content, .admin-content {
    background-color: #0d1117 !important; /* Dark main content */
}

.container, .container-fluid {
    background-color: #0d1117 !important; /* Dark containers */
}

/* Breadcrumb darker */
.breadcrumb {
    background-color: #161b22 !important;
}

.breadcrumb-item a {
    color: #58a6ff !important; /* Blue links */
}

.breadcrumb-item.active {
    color: #e6edf3 !important;
}

/* Alert darker */
.alert {
    background-color: #161b22 !important;
    border-color: #21262d !important;
    color: #e6edf3 !important;
}

.alert-success {
    background-color: rgba(46, 160, 67, 0.15) !important;
    border-color: #2ea043 !important;
    color: #3fb950 !important;
}

.alert-warning {
    background-color: rgba(187, 128, 9, 0.15) !important;
    border-color: #bb8009 !important;
    color: #e3b341 !important;
}

.alert-danger {
    background-color: rgba(248, 81, 73, 0.15) !important;
    border-color: #f85149 !important;
    color: #ff7b72 !important;
}

.alert-info {
    background-color: rgba(56, 139, 253, 0.15) !important;
    border-color: #388bfd !important;
    color: #79c0ff !important;
}

/* Button styles darker */
.btn-outline-secondary {
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

.btn-outline-secondary:hover {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

/* List group darker */
.list-group-item {
    background-color: #161b22 !important;
    border-color: #21262d !important;
    color: #e6edf3 !important;
}

/* Pagination darker */
.page-link {
    background-color: #161b22 !important;
    border-color: #21262d !important;
    color: #58a6ff !important;
}

.page-link:hover {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #58a6ff !important;
}

.page-item.active .page-link {
    background-color: #388bfd !important;
    border-color: #388bfd !important;
    color: #ffffff !important;
}

/* Placeholder text darker theme */
.form-control::placeholder, .form-select::placeholder {
    color: #7d8590 !important; /* Lighter placeholder text */
    opacity: 1 !important;
}

/* Textarea darker */
textarea.form-control {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

/* Input group darker */
.input-group-text {
    background-color: #21262d !important;
    border-color: #30363d !important;
    color: #e6edf3 !important;
}

/* Progress bar darker */
.progress {
    background-color: #21262d !important;
}

.progress-bar {
    background-color: #388bfd !important;
}

/* Badge darker */
.badge {
    background-color: #21262d !important;
    color: #e6edf3 !important;
}

.badge.bg-success {
    background-color: #2ea043 !important;
}

.badge.bg-warning {
    background-color: #bb8009 !important;
}

.badge.bg-danger {
    background-color: #f85149 !important;
}

.badge.bg-info {
    background-color: #388bfd !important;
}

/* Tab darker */
.nav-tabs {
    border-bottom-color: #21262d !important;
}

.nav-tabs .nav-link {
    background-color: #161b22 !important;
    border-color: #21262d !important;
    color: #e6edf3 !important;
}

.nav-tabs .nav-link:hover {
    background-color: #21262d !important;
    border-color: #30363d !important;
}

.nav-tabs .nav-link.active {
    background-color: #0d1117 !important;
    border-color: #21262d #21262d #0d1117 !important;
    color: #e6edf3 !important;
}

/* Text colors */
/* Text-to-Image and Image-to-Video label colors - force white */
.text-cyan,
.text-purple {
    color: white !important;
}
.text-muted {
    color: #7d8590 !important;
}

.text-secondary {
    color: #8b949e !important;
}

/* Link colors */
a {
    color: #58a6ff !important;
}

a:hover {
    color: #79c0ff !important;
}

/* Border colors */
.border {
    border-color: #21262d !important;
}

.border-secondary {
    border-color: #30363d !important;
}

/* Disabled button state */
.btn:disabled, .btn.disabled {
    opacity: 0.6 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Loading spinner in buttons */
.btn .fa-spinner {
    animation: spin 1s linear infinite !important;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Suggestion cards darker theme */
.suggestion-card {
    background-color: #161b22 !important;
    border: 1px solid #21262d !important;
    transition: all 0.3s ease !important;
}

.suggestion-card:hover {
    background-color: #21262d !important;
    border-color: #30363d !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3) !important;
}

/* Heading size adjustments */
h1, .h1 {
    font-size: calc(2.375rem - 2px) !important; /* ~36px reduced to ~34px */
}

h2, .h2 {
    font-size: calc(2rem - 2px) !important; /* ~30px reduced to ~28px */
}

h3, .h3 {
    font-size: calc(1.75rem - 2px) !important; /* ~26px reduced to ~24px */
}

h4, .h4 {
    font-size: calc(1.5rem - 2px) !important; /* ~22px reduced to ~20px */
}

h5, .h5 {
    font-size: calc(1.25rem - 2px) !important; /* ~18px reduced to ~16px */
}

h6, .h6 {
    font-size: calc(1rem - 2px) !important; /* ~14px reduced to ~12px */
}

/* Form elements */
.form-control, .form-select {
    font-size: 14px !important; /* Reduced from 16px */
}

.form-label {
    font-size: 12px !important; /* Reduced from 14px */
}

.form-text {
    font-size: 10px !important; /* Reduced from 12px */
}

/* Button text */
.btn {
    font-size: 14px !important; /* Reduced from 16px */
}

.btn-lg {
    font-size: 16px !important; /* Reduced from 18px */
}

.btn-sm {
    font-size: 12px !important; /* Reduced from 14px */
}

/* Table text */
.table {
    font-size: 14px !important; /* Reduced from 16px */
}

.table th {
    font-size: 13px !important; /* Reduced from 15px */
}

/* Navigation text */
.navbar-brand {
    font-size: calc(1.3rem - 2px) !important; /* ~19px reduced to ~17px */
}

.nav-link {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Card text */
.card-title {
    font-size: calc(1.25rem - 2px) !important; /* ~18px reduced to ~16px */
}

.card-text {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Badge text */
.badge {
    font-size: 11px !important; /* Reduced from 13px */
}

/* Alert text */
.alert {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Lead text */
.lead {
    font-size: calc(1.25rem - 2px) !important; /* ~18px reduced to ~16px */
}

/* Display headings */
.display-1 {
    font-size: calc(5rem - 4px) !important; /* Larger reduction for display headers */
}

.display-2 {
    font-size: calc(4.5rem - 4px) !important;
}

.display-3 {
    font-size: calc(4rem - 4px) !important;
}

.display-4 {
    font-size: calc(3.5rem - 4px) !important;
}

.display-5 {
    font-size: calc(3rem - 4px) !important;
}

.display-6 {
    font-size: calc(2.5rem - 4px) !important;
}

/* Small text */
.small, small {
    font-size: 11px !important; /* Reduced from 13px */
}

/* List group items */
.list-group-item {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Dropdown items */
.dropdown-item {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Modal text */
.modal-title {
    font-size: calc(1.25rem - 2px) !important; /* ~18px reduced to ~16px */
}

.modal-body {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Breadcrumb text */
.breadcrumb-item {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Pagination text */
.page-link {
    font-size: 14px !important; /* Reduced from 16px */
}

/* Global dark theme enforcement */
html[data-bs-theme="dark"] {
    background-color: var(--bs-dark) !important;
    color: var(--bs-light) !important;
}

body {
    background-color: var(--bs-dark) !important;
    color: var(--bs-light) !important;
}

/* Fix white backgrounds on all containers */
.container, .container-fluid {
    background-color: transparent !important;
}

/* Fix white backgrounds on main content areas */
main, section, .main-content {
    background-color: transparent !important;
}

/* Fix modal backgrounds */
.modal-content {
    background-color: var(--bs-dark) !important;
    color: var(--bs-light) !important;
    border: 1px solid var(--bs-secondary) !important;
}

.modal-header, .modal-footer {
    background-color: var(--bs-dark) !important;
    border-color: var(--bs-secondary) !important;
}

/* Fix card backgrounds */
.card {
    background-color: var(--bs-gray-900) !important;
    border: 1px solid var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.card-header, .card-footer {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

/* Fix table backgrounds */
.table {
    --bs-table-bg: var(--bs-dark) !important;
    --bs-table-color: var(--bs-light) !important;
}

.table thead th {
    background-color: var(--bs-gray-800) !important;
    color: var(--bs-light) !important;
    border-color: var(--bs-secondary) !important;
}

/* Fix form backgrounds */
.form-control, .form-select, textarea.form-control {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-primary) !important;
    color: var(--bs-light) !important;
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

/* Specifically target textarea elements */
textarea {
    background-color: var(--bs-gray-800) !important;
    color: var(--bs-light) !important;
    border-color: var(--bs-secondary) !important;
}

textarea::placeholder {
    color: var(--bs-gray-400) !important;
    opacity: 0.8 !important;
}

/* Force dark theme on all admin page elements */
.admin-content *, .admin-main-content *, [class*="admin"] * {
    background-color: inherit !important;
}

/* Specific fix for admin form areas */
.admin-content .form-control, 
.admin-content textarea, 
.admin-content .form-select,
.admin-main-content .form-control,
.admin-main-content textarea,
.admin-main-content .form-select {
    background-color: var(--bs-gray-800) !important;
    color: var(--bs-light) !important;
    border-color: var(--bs-secondary) !important;
}

/* Fix accordion backgrounds */
.accordion-item {
    background-color: var(--bs-gray-900) !important;
    border-color: var(--bs-secondary) !important;
}

.accordion-button {
    background-color: var(--bs-gray-800) !important;
    color: var(--bs-light) !important;
}

.accordion-collapse {
    background-color: var(--bs-gray-900) !important;
}

/* Fix dropdown backgrounds */
.dropdown-menu {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-secondary) !important;
}

.dropdown-item {
    color: var(--bs-light) !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: var(--bs-gray-700) !important;
    color: var(--bs-light) !important;
}

/* Fix pagination backgrounds */
.page-link {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.page-item.active .page-link {
    background-color: var(--bs-primary) !important;
    border-color: var(--bs-primary) !important;
}

/* Fix breadcrumb backgrounds */
.breadcrumb {
    background-color: transparent !important;
}

/* Fix alert backgrounds */
.alert {
    border: 1px solid;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1) !important;
    border-color: var(--bs-info) !important;
    color: var(--bs-info) !important;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1) !important;
    border-color: var(--bs-success) !important;
    color: var(--bs-success) !important;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1) !important;
    border-color: var(--bs-warning) !important;
    color: var(--bs-warning) !important;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1) !important;
    border-color: var(--bs-danger) !important;
    color: var(--bs-danger) !important;
}

/* Fix progress bar backgrounds */
.progress {
    background-color: var(--bs-gray-700) !important;
}

/* Fix list group backgrounds */
.list-group-item {
    background-color: var(--bs-gray-900) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.list-group-item:hover {
    background-color: var(--bs-gray-800) !important;
}

/* Fix navbar dropdown backgrounds */
.navbar-nav .dropdown-menu {
    background-color: var(--bs-gray-800) !important;
}

/* Fix input group backgrounds */
.input-group-text {
    background-color: var(--bs-gray-700) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

/* Fix dashboard and admin specific backgrounds */
.dashboard-container, .admin-container {
    background-color: transparent !important;
}

/* Fix admin layout main content area white background */
.col-md-9.col-lg-10 {
    background-color: var(--bs-dark) !important;
    min-height: 100vh;
}

/* Fix admin form containers */
.admin-form-container, .admin-main-content {
    background-color: var(--bs-dark) !important;
}

/* Fix wallet and campaign forms */
.wallet-form, .campaign-form {
    background-color: var(--bs-gray-900) !important;
    border: 1px solid var(--bs-secondary) !important;
    border-radius: 0.375rem;
    padding: 1.5rem;
}

/* Fix statistics cards */
.stats-card {
    background-color: var(--bs-gray-900) !important;
    border: 1px solid var(--bs-secondary) !important;
}

/* Fix content wrapper areas */
.content-wrapper, .main-wrapper {
    background-color: transparent !important;
}

/* Fix sidebar backgrounds */
.sidebar {
    background-color: var(--bs-gray-900) !important;
    border-right: 1px solid var(--bs-secondary) !important;
}

/* Fix tab content backgrounds */
.tab-content {
    background-color: transparent !important;
}

.tab-pane {
    background-color: transparent !important;
}

/* Fix nav tabs backgrounds */
.nav-tabs {
    border-bottom-color: var(--bs-secondary) !important;
}

.nav-tabs .nav-link {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.nav-tabs .nav-link.active {
    background-color: var(--bs-gray-900) !important;
    border-color: var(--bs-secondary) var(--bs-secondary) var(--bs-gray-900) !important;
    color: var(--bs-light) !important;
}

/* Fix offcanvas backgrounds */
.offcanvas {
    background-color: var(--bs-gray-900) !important;
    color: var(--bs-light) !important;
}

.offcanvas-header {
    border-bottom-color: var(--bs-secondary) !important;
}

/* Fix toast backgrounds */
.toast {
    background-color: var(--bs-gray-800) !important;
    border: 1px solid var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.toast-header {
    background-color: var(--bs-gray-700) !important;
    border-bottom-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

/* Fix badge backgrounds */
.badge {
    border: 1px solid transparent;
}

/* Fix button group backgrounds */
.btn-group .btn {
    border-color: var(--bs-secondary) !important;
}

/* Fix carousel backgrounds */
.carousel-indicators button {
    background-color: var(--bs-gray-600) !important;
}

.carousel-control-prev, .carousel-control-next {
    background-color: rgba(0, 0, 0, 0.3) !important;
}

/* Fix popover backgrounds */
.popover {
    background-color: var(--bs-gray-800) !important;
    border-color: var(--bs-secondary) !important;
    color: var(--bs-light) !important;
}

.popover-header {
    background-color: var(--bs-gray-700) !important;
    border-bottom-color: var(--bs-secondary) !important;
}

/* Fix tooltip backgrounds */
.tooltip .tooltip-inner {
    background-color: var(--bs-gray-700) !important;
}

/* Fix specific form elements */
.form-check-input {
    background-color: var(--bs-gray-700) !important;
    border-color: var(--bs-secondary) !important;
}

.form-check-input:checked {
    background-color: var(--bs-primary) !important;
}

.form-range {
    background-color: transparent !important;
}

.form-range::-webkit-slider-track {
    background-color: var(--bs-gray-600) !important;
}

.form-range::-moz-range-track {
    background-color: var(--bs-gray-600) !important;
}

/* Fix search and filter sections */
.search-section, .filter-section {
    background-color: var(--bs-gray-900) !important;
    border: 1px solid var(--bs-secondary) !important;
    border-radius: 0.375rem;
}

/* Fix influencer profile sections */
.profile-section {
    background-color: var(--bs-gray-900) !important;
    border: 1px solid var(--bs-secondary) !important;
}

/* Fix post generation areas */
.post-generation-area {
    background-color: var(--bs-gray-900) !important;
    border: 1px solid var(--bs-secondary) !important;
}

/* Fix campaign creation forms */
.campaign-creation {
    background-color: var(--bs-gray-900) !important;
}

/* Hero Section Gradient */
.hero-section {
    background: linear-gradient(135deg, var(--bs-primary) 0%, var(--bs-info) 100%);
    position: relative;
    overflow: hidden;
}

/* Card Hover Effects */
.card {
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.influencer-card {
    position: relative;
    cursor: pointer;
}

.influencer-card:hover {
    transform: translateY(-3px);
    border-color: var(--bs-primary) !important;
}

/* Compare checkbox styling */
.compare-checkbox {
    transform: scale(1.2);
}

/* Profile image styling */
img.rounded-circle {
    border: 2px solid var(--bs-light);
    transition: border-color 0.2s ease-in-out;
}

img.rounded-circle:hover {
    border-color: var(--bs-primary);
}

/* Badge enhancements */
.badge {
    font-weight: 500;
    letter-spacing: 0.025em;
}

/* Button enhancements */
.btn {
    transition: all 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
}

/* Table enhancements */
.table th {
    border-bottom: 2px solid var(--bs-border-color);
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

/* Form enhancements */
.form-control:focus,
.form-select:focus {
    border-color: var(--bs-primary);
    box-shadow: 0 0 0 0.2rem rgba(var(--bs-primary-rgb), 0.25);
}

/* Accordion styling */
.accordion-button:not(.collapsed) {
    background-color: var(--bs-primary);
    color: white;
}

.accordion-button:focus {
    box-shadow: none;
    border-color: var(--bs-primary);
}

/* Loading animation */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2.5rem;
    }
    
    /* CREATE REEL PAGE - Mobile Image Responsiveness Fix */
    .img-thumbnail, 
    .clickable-image {
        max-width: 100% !important;
        max-height: 250px !important;
        width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
    }
    
    /* Scene containers responsive layout */
    .scene-container {
        flex-direction: column !important;
        margin-bottom: 1.5rem !important;
    }
    
    /* Image containers full width on mobile */
    .images-container,
    .scene-images-display {
        width: 100% !important;
        margin-bottom: 1rem !important;
    }
    
    /* Ensure scene boxes are mobile-friendly */
    .scene-box {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }
    
    /* HD variant thumbnails mobile sizing */
    .hd-variant-thumbnail {
        width: 50px !important;
        height: 50px !important;
    }
    
    /* Variant thumb containers responsive */
    .variant-thumb img,
    .variant-thumb-img {
        width: 60px !important;
        height: 60px !important;
    }
    
    /* Avatar images responsive - fix for browse page and other avatar displays */
    .rounded-circle,
    .avatar-img,
    .influencer-card img {
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Ensure avatar containers don't break layout on mobile */
    .influencer-card {
        flex-direction: column !important;
        text-align: center !important;
        padding: 1rem !important;
    }
    
    .influencer-card .rounded-circle {
        margin: 0 auto 0.5rem auto !important;
        max-width: 80px !important;
        max-height: 80px !important;
    }
}

.display-5 {
    font-size: 2rem;
}
    
    .lead {
        font-size: 1.1rem;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .hero-section .container {
        padding: 2rem 0;
    }
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar for webkit browsers */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bs-light);
}

::-webkit-scrollbar-thumb {
    background: var(--bs-secondary);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bs-primary);
}

/* Animation classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stats animation on hover */
.card .fw-bold {
    transition: color 0.2s ease-in-out;
}

.card:hover .fw-bold {
    color: var(--bs-primary) !important;
}

/* Navbar enhancements */
.navbar-brand {
    font-weight: 700;
    font-size: 1.3rem;
}

.nav-link {
    font-weight: 500;
    transition: color 0.2s ease-in-out;
}

/* Footer styling */
footer a:hover {
    color: white !important;
}

/* Price range highlighting */
.text-success {
    font-weight: 600;
}

/* Platform badges */
.badge.bg-secondary {
    background-color: var(--bs-secondary) !important;
}

/* Comparison table enhancements */
.table-responsive {
    border-radius: 0.375rem;
}

.table thead th {
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: var(--bs-light);
}

/* Enhanced modal styling */
.modal-content {
    border: none;
    border-radius: 0.5rem;
}

.modal-header {
    border-bottom: 1px solid var(--bs-border-color);
}

/* Contact form enhancements */
.form-label {
    font-weight: 600;
    color: var(--bs-gray-700);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

/* Success message styling */
.alert-success {
    border-left: 4px solid var(--bs-success);
}

.alert-danger {
    border-left: 4px solid var(--bs-danger);
}

.alert-warning {
    border-left: 4px solid var(--bs-warning);
}

.alert-info {
    border-left: 4px solid var(--bs-info);
}

/* Gradient Button for Reel Editor */
.btn-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-gradient:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
    color: white;
}

.btn-gradient:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.btn-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-gradient:hover::before {
    left: 100%;
}

/* ================================
   AUDIO WAVEFORM VISUALIZATIONS
   ================================ */

.audio-waveform {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
    z-index: 1;
    border-radius: 0 0 6px 6px;
}

/* Voiceover waveform styling */
.voiceover-clip .audio-waveform {
    opacity: 0.8;
    filter: drop-shadow(0 1px 2px rgba(255, 107, 107, 0.3));
}

/* Background music waveform styling */
.background-music-clip .audio-waveform {
    opacity: 0.7;
    filter: drop-shadow(0 1px 2px rgba(78, 205, 196, 0.3));
}

/* Timeline clip positioning for waveforms */
.timeline-clip {
    position: relative;
    overflow: hidden;
}

.timeline-clip .clip-content {
    position: relative;
    z-index: 2;
    padding-bottom: 8px;
}

/* Waveform animation on load */
.audio-waveform {
    animation: waveformFadeIn 0.6s ease-out;
}

@keyframes waveformFadeIn {
    from {
        opacity: 0;
        transform: scaleY(0.3);
    }
    to {
        opacity: 0.8;
        transform: scaleY(1);
    }
}

/* Waveform states */
.audio-waveform.loading {
    background: linear-gradient(90deg, #333 25%, #555 50%, #333 75%);
    background-size: 200% 100%;
    animation: waveformShimmer 2s infinite;
}

@keyframes waveformShimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.audio-waveform.error {
    background: repeating-linear-gradient(
        45deg,
        rgba(220, 53, 69, 0.3),
        rgba(220, 53, 69, 0.3) 4px,
        transparent 4px,
        transparent 8px
    );
}

/* High contrast mode waveforms */
@media (prefers-contrast: high) {
    .voiceover-clip .audio-waveform {
        opacity: 1;
        filter: contrast(1.5);
    }
    
    .background-music-clip .audio-waveform {
        opacity: 0.9;
        filter: contrast(1.3);
    }
}

/* Mobile responsive waveforms */
@media (max-width: 768px) {
    .audio-waveform {
        height: 20px !important;
        opacity: 0.6;
    }
    
    .timeline-clip .clip-content {
        padding-bottom: 6px;
    }
}

/* Reduced motion for waveforms */
@media (prefers-reduced-motion: reduce) {
    .audio-waveform {
        animation: none !important;
    }
    
    .audio-waveform.loading {
        animation: none !important;
        background: #555;
    }
}

/* ================================
   VIDEO LAYER FULL COVERAGE IMAGES
   ================================ */

/* Video clips with full image coverage */
.video-clip {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
    min-height: 50px;
}

.video-clip .clip-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    overflow: hidden;
}

.video-clip .scene-thumbnail {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    z-index: 1;
    transition: transform 0.2s ease;
}

.video-clip:hover .scene-thumbnail {
    transform: scale(1.02);
}

.video-clip .scene-label {
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 2px 6px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 3px;
    z-index: 5;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.video-clip .resize-handle {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 8px;
    z-index: 10;
    cursor: ew-resize;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.video-clip:hover .resize-handle {
    opacity: 1;
}

.video-clip .resize-handle.left {
    left: 0;
    border-radius: 6px 0 0 6px;
}

.video-clip .resize-handle.right {
    right: 0;
    border-radius: 0 6px 6px 0;
}

.video-clip .clip-fallback {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #333, #555);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    z-index: 1;
}
