/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    text-align: center;
}

footer {
    background-color: #2c3e50;
    color: white;
    padding: 1rem 0;
    text-align: center;
    margin-top: 2rem;
}

h1, h2, h3 {
    margin-bottom: 1rem;
}

/* Input section */
.input-section {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 12px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"],
input[type="file"],
input[type="number"],
input[type="color"],
textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

input[type="color"] {
    height: 40px;
    padding: 2px;
    cursor: pointer;
}

input[type="number"] {
    width: 100%;
}

textarea {
    resize: vertical;
    font-family: monospace;
}

.hint {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Preview section */
.preview-section {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#preview-canvas {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    background-color: #000;
    margin-bottom: 10px;
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

.copyable {
	cursor: pointer;
}

button {
    padding: 8px 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background-color: #2980b9;
}

#seek-slider {
    flex-grow: 1;
    margin: 0 10px;
}

/* Export section */
.export-section {
    background-color: white;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.primary-button {
    padding: 12px 24px;
    background-color: #27ae60;
    font-size: 16px;
    font-weight: bold;
}

.primary-button:hover {
    background-color: #219653;
}

.progress-bar {
    width: 100%;
    height: 20px;
    background-color: #eee;
    border-radius: 10px;
    margin: 20px 0;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background-color: #27ae60;
    width: 0%;
    transition: width 0.3s ease;
}

#progress-text {
    text-align: center;
    font-weight: bold;
}

.download-button {
    display: inline-block;
    padding: 12px 24px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
    margin-top: 10px;
}

.download-button:hover {
    background-color: #2980b9;
}

.hidden {
    display: none;
}

/* Tab interface */
.tab-container {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 20px;
}

.tab-button {
    padding: 10px 20px;
    background-color: #f5f5f5;
    border: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: #666;
    margin-right: 5px;
}

.tab-button:hover {
    background-color: #e0e0e0;
}

.tab-button.active {
    background-color: #3498db;
    color: white;
}

.tab-content {
    display: none;
}

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

/* Theme editor styles */
.theme-section {
    margin-bottom: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f9f9f9;
}

.theme-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f0f0f0;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
}

.theme-section-header h3 {
    margin: 0;
    font-size: 1.1em;
}

.theme-section-content {
    display: none;
    padding: 10px;
}

.theme-section.open .theme-section-content {
    display: block;
}

.theme-toggle-icon {
    transition: transform 0.3s ease;
}

.theme-section.open .theme-toggle-icon {
    transform: rotate(180deg);
}

.collapsible-section {
    margin-bottom: 8px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.collapsible-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background-color: #f0f0f0;
    cursor: pointer;
}

.collapsible-header h4 {
    margin: 0;
}

.toggle-icon {
    transition: transform 0.3s ease;
}

.collapsible-section.open .toggle-icon {
    transform: rotate(180deg);
}

.collapsible-content {
    padding: 10px;
    display: none;
    background-color: white;
}

.collapsible-section.open .collapsible-content {
    display: block;
}

/* Image preview */
.image-preview {
    margin-top: 10px;
    width: 100%;
    height: 200px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview .placeholder {
    color: #999;
    text-align: center;
}

/* Speaker items */
.speaker-item {
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 15px;
    background-color: white;
}

.speaker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f0f0f0;
    cursor: pointer;
}

.speaker-form {
    padding: 15px;
}

.speaker-header h4 {
    margin: 0;
}

.speaker-images {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.speaker-image-preview {
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.speaker-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.speaker-image-preview .remove-image {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background-color: rgba(255, 0, 0, 0.7);
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 12px;
}

.add-image-button {
    width: 100px;
    height: 100px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    background-color: #f9f9f9;
    color: #666;
}

.add-image-button:hover {
    background-color: #f0f0f0;
}

/* Drag and drop styles */
.drag-highlight {
    border: 2px dashed #3498db;
    background-color: rgba(52, 152, 219, 0.1);
}

.speaker-images {
    min-height: 100px;
    padding: 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.speaker-image-preview {
    transition: all 0.3s ease;
}

.speaker-image-preview.drag-highlight {
    transform: scale(1.05);
    box-shadow: 0 0 10px rgba(52, 152, 219, 0.5);
}

.secondary-button {
    background-color: #7f8c8d;
}

.secondary-button:hover {
    background-color: #6c7a7a;
}

.remove-button {
    background-color: #e74c3c;
}

.remove-button:hover {
    background-color: #c0392b;
}

/* Transcription UI Styles */
.transcription-options h4 {
    margin-top: 0;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ddd;
}

.option-group {
    margin-bottom: 15px;
}

.option-group label {
    display: block;
    margin-bottom: 5px;
}

.option-group input[type="radio"] {
    margin-right: 5px;
}

.transcription-progress {
    margin: 20px 0;
}

#transcription-result {
    font-family: monospace;
    white-space: pre-wrap;
}

.results-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

/* Model status styles */
.model-status-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

#model-status-value {
    font-weight: bold;
    margin-left: 5px;
}

#model-download-progress {
    margin-top: 10px;
    margin-bottom: 5px;
}

#model-download-status {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* Font status styles */
.font-status {
    font-size: 12px;
    margin-top: 5px;
    padding: 3px 6px;
    border-radius: 3px;
    display: inline-block;
}

.font-status.success {
    background-color: #d4edda;
    color: #155724;
}

.font-status.error {
    background-color: #f8d7da;
    color: #721c24;
}

.font-status.loading {
    background-color: #fff3cd;
    color: #856404;
}

/* Responsive design */
@media (min-width: 768px) {
    .container {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }
    
    .input-section {
        grid-column: 1;
    }
    
    .preview-section, .export-section {
        grid-column: 2;
    }
}

@media (max-width: 767px) {
    #preview-canvas {
        max-height: 70vh;
    }
    
    /* Font input styles */
    .font-input-container {
        margin-bottom: 15px;
    }
    
    .font-preview {
        margin-top: 10px;
        padding: 10px;
        border: 1px solid #ddd;
        border-radius: 4px;
        background-color: #f9f9f9;
        font-size: 18px;
    }
    
    .font-preview-text {
        display: block;
        margin-bottom: 5px;
    }
}
/* Cue Editor Styles */
.cue-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.cue-item {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 5px;
    overflow: hidden;
}

.cue-item.overlapping {
    border-color: #f0ad4e;
    background-color: #fcf8e3;
}

.cue-form .input-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background-color: white;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.overlap-warning {
    color: #8a6d3b;
    background-color: #fcf8e3;
    padding: 3px 5px;
    margin-left: 5px;
    border-radius: 3px;
    font-size: 0.8em;
    display: inline-block;
}

.cue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    background-color: #f0f0f0;
    cursor: pointer;
    border-bottom: 1px solid #ddd;
}

.cue-preview {
	display: inline-block;
    font-weight: bold;
    font-size: 0.8em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	width: 6rem;
}

.cue-toggle-icon {
    transition: transform 0.3s ease;
    margin-left: 5px;
    font-size: 0.8em;
}

.cue-item.open .cue-toggle-icon {
    transform: rotate(180deg);
}

.cue-time-display {
    font-size: 0.85em;
    color: #666;
    margin-left: 5px;
}

.cue-controls {
    display: flex;
    gap: 5px;
}

.cue-controls button {
    width: 30px;
    height: 30px;
    border-radius: 4px;
    border: 1px solid #ccc;
    background-color: #fff;
    cursor: pointer;
	color: black;
	padding: 0;
}

.cue-controls button:hover {
    background-color: #eee;
}

.delete-button {
    color: #d9534f;
}

.cue-form {
    display: none;
    flex-direction: column;
    gap: 8px;
    padding: 10px;
    background-color: white;
}

.cue-item.open .cue-form {
    display: flex;
}

.cue-times {
    display: flex;
    gap: 8px;
}

.cue-times .input-group {
    flex: 1;
}

#editor-toggle {
    margin-bottom: 15px;
}

.validation-errors {
    background-color: #f2dede;
    color: #a94442;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 4px;
}

.validation-errors ul {
    margin: 0;
    padding-left: 20px;
}

.validation-errors li {
    cursor: pointer;
    margin-bottom: 5px;
}

.validation-errors li:hover {
    text-decoration: underline;
}


.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.modal-content {
  background: #fff;
  padding: 20px;
  width: 80%;
  max-width: 600px;
  border-radius: 8px;
}