body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 20px;
    background: #f5f5f5;
}
.header {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.project-selector {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.project-selector label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
}

.project-selector select {
    padding: 8px 12px;
    font-size: 14px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    min-width: 200px;
    font-family: inherit;
}

.project-selector select:hover {
    border-color: #007AFF;
}

.project-selector select:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.15);
}

.project-loading {
    font-size: 12px;
    color: #6c757d;
    margin-left: 10px;
}

/* Statistics Dashboard */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.stat-card {
    background: white;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: all 0.2s;
    border: 1px solid #e1e5e9;
}

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

.stat-icon {
    font-size: 24px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.stat-card.warning .stat-value {
    color: #dc3545;
}

.stat-card.success .stat-value {
    color: #28a745;
}

.stat-card.info .stat-value {
    color: #007AFF;
}

.timeline {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.broll-item {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.broll-item:hover {
    border-color: #007AFF;
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f3ff 100%);
    box-shadow: 0 4px 16px rgba(0,122,255,0.15);
    transform: translateY(-1px);
}
.broll-preview {
    width: 240px;
    height: 136px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 12px;
}
.broll-info {
    flex: 1;
    position: relative;
}
.broll-timing {
    font-weight: 600;
    color: #007AFF;
    margin-bottom: 6px;
    font-size: 14px;
}
.broll-text {
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 6px;
    line-height: 1.5;
    word-wrap: break-word;
    font-weight: 400;
}
.broll-file {
    color: #6c757d;
    font-size: 11px;
    font-family: 'SF Mono', Monaco, 'Cascadia Code', 'Roboto Mono', Consolas, 'Courier New', monospace;
    background: rgba(108, 117, 125, 0.1);
    padding: 4px 6px;
    border-radius: 4px;
    display: inline-block;
}
.drop-zone {
    width: 240px;
    height: 136px;
    border: 2px dashed #007AFF;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #007AFF;
    font-size: 11px;
    margin-left: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: rgba(0,122,255,0.02);
}
.drop-zone:hover {
    background: rgba(0,122,255,0.08);
    border-color: #0056b3;
    transform: scale(1.02);
}

/* Effet de survol pour les thumbnails B-roll */
.broll-thumbnail {
    position: relative;
    cursor: pointer;
    transition: all 0.2s ease;
}

.broll-thumbnail:hover {
    transform: scale(1.02);
}

.broll-thumbnail.zoomed {
    transform: scale(2.5);
    z-index: 99999;
    position: fixed !important;
    transition: transform 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    border: 3px solid #007AFF;
    border-radius: 8px;
}

.broll-thumbnail.zoomed .broll-video-preview {
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
}

.broll-zoom-label {
    position: fixed;
    z-index: 100000;
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    max-width: 400px;
    text-align: center;
    word-wrap: break-word;
    pointer-events: none;
}

.drop-zone.dragover {
    background: #007AFF;
    color: white;
    transform: scale(1.05);
}
.status {
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
    display: none;
}
.status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}
.status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}
.loading {
    display: none;
    text-align: center;
    padding: 40px;
    color: #666;
}
.preview-button {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.preview-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(40, 167, 69, 0.4);
}
.preview-button.paused {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}
.preview-button.paused:hover {
    box-shadow: 0 6px 16px rgba(220, 53, 69, 0.4);
}
.broll-item.active {
    border-color: #dc3545;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%);
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.2);
}
.audio-preview-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,122,255,0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1000;
}
.audio-preview-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,122,255,0.4);
}
.audio-preview-btn.paused {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    box-shadow: 0 4px 12px rgba(40,167,69,0.3);
}
.audio-preview-btn.paused:hover {
    box-shadow: 0 6px 16px rgba(40,167,69,0.4);
}
.audio-play-overlay-top,
.audio-play-overlay-bottom {
    position: fixed;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.8);
    pointer-events: none;
    z-index: 50;
    display: none;
}
.audio-play-overlay-top {
    top: 0;
    height: 0;
}
.audio-play-overlay-bottom {
    bottom: 120px;
    height: 0;
}
.audio-play-overlay-top.show,
.audio-play-overlay-bottom.show {
    display: block;
}
.audio-preview-wrap {
    position: fixed;
    bottom: 70px;
    right: 20px;
    z-index: 100;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(255,255,255,0.95);
    padding: 8px 12px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.audio-preview-speed {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #333;
}
.audio-preview-speed input[type="range"] {
    width: 70px;
    accent-color: #007AFF;
}
.audio-preview-speed span {
    min-width: 32px;
    font-weight: 600;
}
.broll-item.playing-audio {
    border-color: #dc3545 !important;
    background: linear-gradient(135deg, #fff5f5 0%, #ffe6e6 100%) !important;
    box-shadow: 0 4px 16px rgba(220, 53, 69, 0.2) !important;
}
.rush-group-header.playing-audio-group > div {
    background: #dc3545 !important;
    color: white !important;
}
.rush-group-header > div {
    background: #6c757d !important;
    color: white !important;
}

/* Style pour les b-rolls en doublon */
.broll-duplicate-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(220, 53, 69, 0.6);
    border-radius: 8px;
    pointer-events: none;
    z-index: 10;
}
/* Overlay noir 80% opacité sur thumbnails (Alternative/Alt2 quand Principale cochée, ou les 3 quand image Ajouter) */
.broll-thumbnail-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    pointer-events: none;
    z-index: 5;
}

/* Badge compteur pour duplicatas */
.duplicate-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: #dc3545;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: bold;
    z-index: 15;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
    transition: transform 0.2s, background 0.2s;
}

.duplicate-badge:hover {
    transform: scale(1.1);
    background: #c82333;
}

/* Modal pour afficher les duplicatas */
.duplicate-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.duplicate-modal.show {
    display: flex;
}

.duplicate-modal-content {
    background: white;
    border-radius: 12px;
    padding: 20px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.duplicate-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 10px;
}

.duplicate-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
}

.duplicate-list-item {
    padding: 10px;
    margin: 5px 0;
    background: #f8f9fa;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.duplicate-list-item:hover {
    background: #e9ecef;
}

.duplicate-list-item.current {
    background: #d1ecf1;
    border: 2px solid #0c5460;
}

/* ============================================
   TABS NAVIGATION
   ============================================ */
.tabs-container {
    display: flex;
    gap: 0;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
    background: white;
    padding: 0 20px;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-button {
    padding: 15px 30px;
    background: transparent;
    border: none;
    color: #6c757d;
    font-size: 16px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.tab-button:hover {
    color: #2c3e50;
    background: rgba(0, 122, 255, 0.05);
}

.tab-button.active {
    color: #007AFF;
    border-bottom-color: #007AFF;
    font-weight: 600;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ============================================
   THUMBNAIL GENERATOR
   ============================================ */
.thumbnail-section {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thumbnail-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

.youtube-url-section {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.youtube-url-section label {
    display: block;
    color: #495057;
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 10px;
}

.youtube-url-row {
    display: flex;
    gap: 10px;
}

.youtube-url-row input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
}

.youtube-url-row input:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.15);
}

.youtube-url-row button {
    padding: 8px 16px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.youtube-url-row button:hover:not(:disabled) {
    background: #0056b3;
}

.youtube-url-row button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.youtube-url-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 8px;
    min-height: 16px;
}

.upload-zone {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.upload-box {
    flex: 1;
    min-width: 250px;
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-box:hover {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.05);
}

.upload-box.has-image {
    border-style: solid;
    border-color: #28a745;
    background: rgba(40, 167, 69, 0.05);
}

.upload-box.drag-over {
    border-color: #007AFF;
    background: rgba(0, 122, 255, 0.1);
    transform: scale(1.02);
}

.upload-box.loading {
    opacity: 0.6;
    pointer-events: none;
}

.upload-box img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.upload-box .icon {
    font-size: 48px;
    margin-bottom: 10px;
    opacity: 0.5;
}

.upload-box .label {
    color: #2c3e50;
    font-size: 14px;
    font-weight: 600;
}

.upload-box .sublabel {
    color: #6c757d;
    font-size: 12px;
    margin-top: 5px;
}

.upload-box input[type="file"] {
    display: none;
}

/* Pipeline */
.pipeline-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 30px;
    border: 1px solid #dee2e6;
}

.pipeline-steps {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.pipeline-step {
    padding: 12px 24px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
}

.pipeline-step:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pipeline-step:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.pipeline-step.done {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

.pipeline-step.loading {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.pipeline-arrow {
    color: #6c757d;
    font-size: 20px;
}

.pipeline-info {
    color: #6c757d;
    font-size: 14px;
    line-height: 1.6;
}

.pipeline-info strong {
    color: #2c3e50;
}

/* Results grid */
.results-container {
    margin-top: 20px;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.result-card {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.result-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #e9ecef;
}

.result-card .lang-label {
    padding: 8px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: #f8f9fa;
}

.result-card .lang-label .flag {
    font-size: 16px;
}

.result-card.pending {
    opacity: 0.5;
}

.result-card.pending img {
    filter: grayscale(100%);
}

.result-card.done .lang-label {
    background: #d4edda;
    color: #155724;
}

.result-card.error .lang-label {
    background: #f8d7da;
    color: #721c24;
}

.download-all-btn {
    margin-top: 20px;
    padding: 15px 30px;
    background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

.download-all-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.download-all-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* New Variations Grid Layout */
.results-by-language {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.language-section {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    border: 1px solid #dee2e6;
}

.language-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #dee2e6;
}

.language-header .flag {
    font-size: 24px;
}

.language-header .lang-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 16px;
}

.language-header .lang-status {
    margin-left: auto;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 12px;
    background: #e9ecef;
    color: #6c757d;
}

.language-header .lang-status.done {
    background: #d4edda;
    color: #155724;
}

.language-header .lang-status.error {
    background: #f8d7da;
    color: #721c24;
}

.language-header .regen-btn {
    margin-left: 8px;
    padding: 4px 8px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.language-header .regen-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.language-header .regen-btn.loading {
    opacity: 0.5;
    pointer-events: none;
}

.variations-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 5px 0;
}

.variation-card {
    flex: 0 0 200px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 3px solid transparent;
    transition: all 0.2s ease;
    cursor: pointer;
}

.variation-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

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

.variation-card img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    background: #e9ecef;
}

.variation-card .variation-label {
    padding: 8px 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-top: 1px solid #eee;
}

.variation-card .variation-label .v-number {
    font-weight: 600;
    color: #495057;
}

.variation-card .variation-label .v-status {
    color: #6c757d;
}

.variation-card.selected .variation-label {
    background: #d4edda;
}

.variation-card.selected .variation-label .v-status {
    color: #28a745;
    font-weight: 600;
}

.variation-card.pending {
    opacity: 0.5;
}

.variation-card.pending img {
    filter: grayscale(100%);
}

.variation-card.error {
    border-color: #dc3545;
    opacity: 0.7;
}

.download-selected-btn {
    margin-top: 20px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
    margin-right: 10px;
}

.download-selected-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.download-selected-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
    opacity: 0.5;
}

/* ============================================
   YOUTUBE METADATA
   ============================================ */
.youtube-section {
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.youtube-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

.youtube-controls {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.generate-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #007AFF 0%, #0051D5 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
}

.generate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.youtube-status {
    font-size: 14px;
    color: #6c757d;
    min-height: 20px;
    display: block;
    visibility: visible;
}

.youtube-status.success {
    color: #28a745;
}

.youtube-status.error {
    color: #dc3545;
}

.youtube-status.loading {
    color: #ffc107;
    font-weight: 600;
    display: block !important; /* Override .loading { display: none } */
}

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

.youtube-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.youtube-field label {
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
}

.youtube-field-with-save {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.youtube-field-with-save input,
.youtube-field-with-save textarea {
    flex: 1;
}

.youtube-field-with-save input {
    height: auto;
}

.youtube-field-with-save .save-btn {
    margin-top: 0;
    align-self: flex-start;
}

.youtube-field input,
.youtube-field textarea {
    padding: 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
}

.youtube-field input {
    height: auto;
}

.youtube-field textarea {
    resize: vertical;
    min-height: 120px;
}

.youtube-field input:focus,
.youtube-field textarea:focus {
    outline: none;
    border-color: #007AFF;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.save-btn {
    padding: 12px 16px;
    background: #28a745;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.save-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.youtube-hint {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.youtube-collapsible-label {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.youtube-collapsible-label:hover {
    background-color: #f8f9fa;
}

.youtube-collapsible-label span {
    font-size: 12px;
    transition: transform 0.2s ease;
}

.youtube-collapsible-content {
    margin-top: 10px;
}

.youtube-collapsible-content.collapsed {
    display: none !important;
}

/* Traductions par langue */
.youtube-translations {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid #dee2e6;
}

.youtube-translations h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 18px;
}

.youtube-lang-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    border-bottom: 2px solid #dee2e6;
    padding-bottom: 0;
}

.youtube-lang-tab {
    padding: 10px 20px;
    background: #f8f9fa;
    border: none;
    border-bottom: 3px solid transparent;
    color: #6c757d;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    border-radius: 8px 8px 0 0;
    font-family: inherit;
}

.youtube-lang-tab:hover {
    background: #e9ecef;
    color: #2c3e50;
}

.youtube-lang-tab.active {
    background: white;
    color: #007AFF;
    border-bottom-color: #007AFF;
    font-weight: 600;
}

.youtube-lang-content-item {
    display: none;
}

.youtube-lang-content-item.active {
    display: block;
}

.youtube-lang-translate-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-bottom: 20px;
}

.youtube-lang-translate-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

.youtube-lang-translate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.youtube-inject-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #dee2e6;
}

.youtube-inject-btn {
    padding: 10px 20px;
    background: linear-gradient(135deg, #007AFF 0%, #0056b3 100%);
    border: none;
    border-radius: 8px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-bottom: 15px;
}

.youtube-inject-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

.youtube-inject-code-container {
    display: none;
    margin-top: 15px;
}

.youtube-inject-code-container.show {
    display: block;
}

.youtube-inject-textarea-wrapper {
    position: relative;
}

.youtube-inject-textarea {
    width: 100%;
    min-height: 300px;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    background: #f8f9fa;
}

.youtube-inject-copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 8px 12px;
    background: #28a745;
    border: none;
    border-radius: 6px;
    color: white;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.youtube-inject-copy-btn:hover {
    background: #218838;
    transform: scale(1.05);
}

.banana-prompt-btn {
    margin-top: 8px;
    padding: 6px 12px;
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    border: none;
    border-radius: 6px;
    color: #212529;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s ease;
}
.banana-prompt-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(224, 168, 0, 0.4);
}

/* Create Tab Styles */
.create-section {
    padding: 30px;
}

.create-form {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.create-field {
    margin-bottom: 15px;
}

.create-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.create-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
}

.create-info {
    background: #e9ecef;
    padding: 10px 15px;
    border-radius: 4px;
    margin: 15px 0;
}

.create-info p {
    margin: 5px 0;
}

.create-progress {
    text-align: center;
    padding: 30px;
}

.progress-spinner {
    font-size: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.create-result {
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.create-result.success {
    background: #d4edda;
    color: #155724;
}

.create-result.error {
    background: #f8d7da;
    color: #721c24;
}

/* Script Preview Styles */
.create-step2 {
    margin-top: 20px;
}

.create-step2 h4 {
    margin-bottom: 15px;
    color: #28a745;
}

.script-preview {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    max-height: 500px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.6;
}

.script-preview .script-hook {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #ffc107;
}

.script-preview .script-hook h5 {
    margin: 0 0 10px 0;
    color: #856404;
}

.script-preview .script-section {
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e9ecef;
}

.script-preview .script-section h5 {
    margin: 0 0 10px 0;
    color: #007AFF;
    font-size: 15px;
}

.script-preview .micro-section {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 10px;
}

.script-preview .micro-section h6 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 13px;
}

.script-preview .micro-section p {
    margin: 0;
    color: #212529;
}

/* Voice-over text highlighting */
.script-preview .voice-over-text {
    color: #0066cc !important;
    font-weight: 600;
}

.script-preview .voice-over-notice {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    border-left: 4px solid #2196f3;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
}

.script-preview .voice-over-notice .voice-over-icon {
    font-size: 18px;
}

.script-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.script-actions button {
    flex: 1;
    padding: 15px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-reject {
    background: #dc3545;
    color: white;
}

.btn-reject:hover {
    background: #c82333;
}

.btn-validate {
    background: #28a745;
    color: white;
}

.btn-validate:hover {
    background: #218838;
}

.btn-record {
    background: #6f42c1;
    color: white;
}

.btn-record:hover {
    background: #5a32a3;
}

/* ============================================
   RECORD TAB
   ============================================ */

.record-container {
    padding: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.record-progress-bar {
    position: relative;
    height: 32px;
    background: #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.record-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #20c997);
    transition: width 0.4s ease;
    border-radius: 16px;
}

.record-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.record-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    gap: 10px;
}

.record-nav-btn {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-size: 14px;
}

.record-nav-btn:hover:not(:disabled) {
    background: #f0f0f0;
}

.record-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
}

.record-nav-label {
    font-weight: 600;
    font-size: 16px;
    text-align: center;
    flex: 1;
}

.record-script-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    font-size: 17px;
    line-height: 1.7;
}

.record-sentence {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e9ecef;
}

.record-sentence:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.record-status {
    text-align: center;
    margin-bottom: 16px;
    font-size: 15px;
}

.record-done {
    color: #28a745;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.record-pending { color: #dc3545; }
.record-uploading { color: #ffc107; }
.record-error { color: #dc3545; }

/* Push-to-Talk Button */
.record-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-bottom: 20px;
}

.record-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #e53e3e, #c53030);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
    transition: transform 0.15s, box-shadow 0.15s;
}

.record-btn:hover {
    transform: scale(1.05);
}

.record-btn:active,
.record-btn.recording {
    transform: scale(0.92);
    box-shadow: 0 0 0 10px rgba(229, 62, 62, 0.25);
}

.record-btn.recording {
    animation: record-pulse 1s infinite;
}

@keyframes record-pulse {
    0%, 100% { box-shadow: 0 0 0 10px rgba(229, 62, 62, 0.25); }
    50% { box-shadow: 0 0 0 20px rgba(229, 62, 62, 0.1); }
}

.record-btn-icon {
    font-size: 36px;
}

.record-btn-label {
    font-size: 11px;
    text-align: center;
    line-height: 1.3;
}

.record-timer {
    font-size: 20px;
    font-weight: 600;
    color: #e53e3e;
    letter-spacing: 0.05em;
}

.record-finalize {
    text-align: center;
    margin-top: 20px;
}

.record-finalize-btn {
    padding: 14px 28px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.record-finalize-btn:hover:not(:disabled) {
    background: #218838;
}

.record-finalize-btn:disabled {
    background: #6c757d;
    cursor: wait;
}

.record-empty {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    font-size: 16px;
}

.record-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
}

@media (max-width: 600px) {
    .record-script-card {
        font-size: 16px;
        padding: 14px;
    }

    .record-btn {
        width: 100px;
        height: 100px;
    }

    .record-btn-icon {
        font-size: 30px;
    }

    .record-nav-btn {
        padding: 8px 12px;
        font-size: 14px;
    }
}

/* ============================================
   LOGIN OVERLAY
   ============================================ */

.login-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.login-box {
    background: white;
    border-radius: 16px;
    padding: 40px 36px;
    width: 100%;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.login-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.login-title {
    margin: 0 0 6px;
    font-size: 22px;
    font-weight: 700;
    color: #1a1a2e;
}

.login-subtitle {
    margin: 0 0 24px;
    font-size: 14px;
    color: #6c757d;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.login-input {
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
    text-align: center;
}

.login-input:focus {
    border-color: #4a90d9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.15);
}

.login-error {
    color: #dc3545;
    font-size: 14px;
    font-weight: 500;
}

.login-btn {
    padding: 12px;
    background: #1a1a2e;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.login-btn:hover {
    background: #2d2d4e;
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .tabs-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding: 0 8px;
    }

    .tab-button {
        padding: 10px 14px;
        font-size: 13px;
        white-space: nowrap;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */
@media (max-width: 480px) {
    body {
        padding: 6px;
    }

    .tabs-container {
        gap: 0;
        padding: 0 4px;
    }

    .tab-button {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Mobile record tab: fixed layout so buttons are always visible */
    #record-tab {
        overflow: hidden;
    }

    .record-container {
        display: flex;
        flex-direction: column;
        height: calc(100svh - 130px);
        overflow: hidden;
        padding: 8px 12px;
    }

    .record-script-card {
        flex: 1;
        min-height: 0;
        max-height: none;
        font-size: 16px;
        padding: 14px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .record-controls {
        margin-bottom: 8px;
    }

    .record-status {
        margin-bottom: 8px;
    }

    .record-progress-bar {
        margin-bottom: 8px;
        flex-shrink: 0;
    }

    .record-btn {
        width: 100px;
        height: 100px;
    }

    .record-btn-icon {
        font-size: 30px;
    }

    .record-nav-btn {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 60px;
    }
}

#generateScriptBtn {
    width: 100%;
    padding: 15px;
    background: #007AFF;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
}

#generateScriptBtn:hover:not(:disabled) {
    background: #0056b3;
}

#generateScriptBtn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* ============================================
   RENDER TAB (Lambda Generation)
   ============================================ */
.render-section {
    background: #f5f5f5;
}

/* Server status */
#render-server-status {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#render-server-status .status-connected {
    color: #28a745;
    font-weight: 600;
    font-size: 16px;
}

#render-server-status .status-disconnected {
    color: #dc3545;
    font-weight: 600;
    font-size: 16px;
}

#render-server-status .status-checking {
    color: #ffc107;
    font-size: 16px;
}

#render-server-status .status-url {
    color: #6c757d;
    font-size: 12px;
}

#render-server-status .status-error {
    color: #dc3545;
    font-size: 12px;
}

#render-server-status .status-hint {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
    margin-top: 5px;
}

/* Render language cards */
.render-lang-card {
    background: white;
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.render-lang-card.rendering {
    border-color: #ffc107;
    background: #fffdf0;
}

.render-lang-card.completed {
    border-color: #28a745;
    background: #f0fff4;
}

.render-lang-card.failed {
    border-color: #dc3545;
    background: #fff5f5;
}

.render-lang-card .lang-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.render-lang-card .lang-flag {
    font-size: 24px;
}

.render-lang-card .lang-name {
    font-weight: 600;
    color: #2c3e50;
}

.render-lang-card .lang-progress {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.render-lang-card .progress-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.render-lang-card .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00d9ff, #007AFF);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.render-lang-card.completed .progress-fill {
    background: linear-gradient(90deg, #28a745, #1e7e34);
}

.render-lang-card.failed .progress-fill {
    background: linear-gradient(90deg, #dc3545, #c82333);
}

.render-lang-card .progress-text {
    font-size: 12px;
    color: #6c757d;
}

.render-lang-card .lang-url {
    margin-top: 10px;
}

.render-lang-card .lang-url a {
    color: #007AFF;
    text-decoration: none;
    font-size: 13px;
}

.render-lang-card .lang-url a:hover {
    text-decoration: underline;
}

/* Render history */
.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
}

.history-item:hover {
    background: #e9ecef;
}

.history-item.success {
    border-left: 4px solid #28a745;
}

.history-item.error {
    border-left: 4px solid #dc3545;
}

.history-item.running {
    border-left: 4px solid #ffc107;
    background: #fffdf0;
}

.history-item.pending {
    border-left: 4px solid #6c757d;
}

.history-item .history-status {
    font-size: 18px;
}

.history-item .history-project {
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

.history-item .history-langs {
    font-size: 14px;
}

.history-item .history-date {
    font-size: 12px;
    color: #6c757d;
}

.history-empty,
.history-error {
    text-align: center;
    padding: 20px;
    color: #6c757d;
}

/* Results links */
.results-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.result-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #007AFF;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
}

.result-link:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

/* Generated URLs Section */
.generated-urls-section {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border: 2px solid #4CAF50;
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
}

.generated-urls-section .urls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.generated-urls-section .urls-header h4 {
    margin: 0;
    color: #2e7d32;
    font-size: 18px;
}

.generated-urls-section .copy-all-btn {
    background: #4CAF50;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.generated-urls-section .copy-all-btn:hover {
    background: #388e3c;
}

.generated-urls-section .urls-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.generated-urls-section .url-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #c8e6c9;
}

.generated-urls-section .url-item .url-lang {
    min-width: 120px;
    font-weight: 600;
    color: #2e7d32;
}

.generated-urls-section .url-item input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
    font-family: monospace;
    background: #f5f5f5;
}

.generated-urls-section .url-item button,
.generated-urls-section .url-item a {
    background: #f5f5f5;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.generated-urls-section .url-item button:hover,
.generated-urls-section .url-item a:hover {
    background: #e0e0e0;
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translateY(20px); }
    20% { opacity: 1; transform: translateY(0); }
    80% { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-20px); }
}
