/* BBC Bias Transcript Styles */

/* Custom highlighting classes */
.highlight-yellow {
    background-color: #ffeb3b;
}

.highlight-lime {
    background-color: #00ff80;
}

body {
    font-family: ui-sans-serif, system-ui, sans-serif, "Inter";
    line-height: 1.6;
    background-color: #f7f7f7;
    color: #1f2937;
}

header {
    font-family: "Inter", ui-sans-serif, system-ui, sans-serif;
}

/* Styling for the main content blocks (paragraphs/segments) */
.transcript-segment {
    margin-bottom: 1.5rem;
    padding-left: 0.5rem;
    border-left: 2px solid #e5e7eb;
}

/* Speaker and Timing Layout */
.speaker-line {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}

/* Visual page break separator */
.page-separator {
    margin: 4rem 0;
    border: none;
    border-top: 4px dotted #d1d5db;
}

/* Document content styling */
.document-content p {
    margin-bottom: 1rem;
    text-indent: 0;
}

.document-content .header {
    font-weight: bold;
    text-transform: uppercase;
    margin-top: 2rem;
    margin-bottom: 0.5rem;
    color: #4b5563;
}

.document-content ul {
    list-style-type: disc;
    margin-left: 1.5rem;
    padding-left: 0.5rem;
}

.document-content li {
    margin-bottom: 0.5rem;
}

/* Word highlighting for audio sync */
.word-active {
    background-color: #fef08a;
    border-radius: 2px;
    transition: background-color 0.1s ease;
}

.segment-active {
    border-left-color: #3b82f6;
    border-left-width: 3px;
}

/* Edit Mode Styles */
:root {
    --highlight-color-a: #ffeb3b;
    --highlight-color-b: #00ff80;
}

body.edit-mode .highlight-yellow {
    background-color: var(--highlight-color-a);
}

body.edit-mode .highlight-lime {
    background-color: var(--highlight-color-b);
}

.edit-control-panel {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 9999;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    padding: 16px;
    min-width: 220px;
    font-size: 13px;
    display: none;
}

body.edit-mode .edit-control-panel {
    display: block;
}

.edit-control-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    display: flex;
    align-items: center;
    gap: 6px;
}

.edit-control-panel .panel-section {
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
}

.edit-control-panel .panel-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.edit-control-panel .section-label {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.edit-control-panel button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #fff;
    color: #374151;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-bottom: 6px;
}

.edit-control-panel button:last-child {
    margin-bottom: 0;
}

.edit-control-panel button:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.edit-control-panel button.btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

.edit-control-panel button.btn-primary:hover {
    background: #2563eb;
}

.edit-control-panel button.btn-danger {
    background: #fee2e2;
    border-color: #fecaca;
    color: #dc2626;
}

.edit-control-panel button.btn-danger:hover {
    background: #fecaca;
}

.edit-control-panel button.btn-danger.confirm {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.edit-control-panel button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.edit-control-panel button:disabled:hover {
    background: #fff;
    border-color: #d1d5db;
}

.undo-redo-row {
    display: flex;
    gap: 8px;
}

.undo-redo-row button {
    flex: 1;
    margin-bottom: 0;
}

.color-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.color-row:last-child {
    margin-bottom: 0;
}

.color-row label {
    flex: 1;
    font-size: 12px;
    color: #4b5563;
}

.color-row input[type="color"] {
    width: 32px;
    height: 24px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    cursor: pointer;
    padding: 0;
}

.color-row .highlight-btn {
    width: auto;
    flex: none;
    padding: 4px 10px;
    margin-bottom: 0;
    font-size: 11px;
}

.color-row .highlight-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: #fff;
}

body.edit-mode [contenteditable="true"]:focus {
    outline: 2px dashed #3b82f6;
    outline-offset: 2px;
    border-radius: 2px;
}

body.edit-mode [contenteditable="true"]:hover {
    background-color: rgba(59, 130, 246, 0.05);
}

/* Highlighter cursor mode */
body.highlighter-mode-a {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="8" y="2" width="8" height="16" rx="2" fill="%23FFB8A3" stroke="%23333" stroke-width="1"/><path d="M10 18 L14 18 L12 22 Z" fill="%23333"/></svg>') 12 22, text;
}

body.highlighter-mode-b {
    cursor: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><rect x="8" y="2" width="8" height="16" rx="2" fill="%23A3E4D7" stroke="%23333" stroke-width="1"/><path d="M10 18 L14 18 L12 22 Z" fill="%23333"/></svg>') 12 22, text;
}

.edit-mode-indicator {
    position: fixed;
    top: 16px;
    right: 16px;
    background: #3b82f6;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 9999;
    display: none;
    transition: all 0.2s ease;
}

body.edit-mode .edit-mode-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
}

.edit-mode-indicator.saving {
    background: #f59e0b;
}

.edit-mode-indicator.saved {
    background: #10b981;
}

.save-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.save-check {
    display: none;
}

.edit-mode-indicator.saved .save-check {
    display: inline;
}

.edit-mode-indicator.saved .save-spinner,
.edit-mode-indicator.saving .save-check {
    display: none;
}

.edit-mode-indicator:not(.saving):not(.saved) .save-spinner,
.edit-mode-indicator:not(.saving):not(.saved) .save-check {
    display: none;
}