/* Subtitle Editor Styles */

/* Toolbar */
.subtitle-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

[data-bs-theme="dark"] .subtitle-toolbar {
    background: #212529;
    border-color: #495057;
}

/* Table Wrapper */
.subtitle-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

[data-bs-theme="dark"] .subtitle-table-wrapper {
    border-color: #495057;
}

/* Table */
.subtitle-table {
    margin-bottom: 0;
    font-size: 14px;
}

.subtitle-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.subtitle-table th {
    font-weight: 600;
    white-space: nowrap;
    vertical-align: middle;
}

.subtitle-table td {
    vertical-align: middle;
}

/* Column widths */
.col-check {
    width: 40px;
    text-align: center;
}

.col-index {
    width: 50px;
    text-align: center;
    font-weight: 600;
    color: #6c757d;
}

.col-time {
    width: 140px;
}

.col-text {
    min-width: 200px;
}

.col-actions {
    width: 100px;
    white-space: nowrap;
}

/* Time input */
.time-input {
    font-family: 'Courier New', Courier, monospace;
    font-size: 13px;
    text-align: center;
}

/* Text input */
.text-input {
    font-size: 13px;
    resize: vertical;
    min-height: 50px;
}

/* Entry checkbox */
.entry-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Selected row */
.subtitle-table tbody tr:has(.entry-checkbox:checked) {
    background-color: #e7f5ff !important;
}

[data-bs-theme="dark"] .subtitle-table tbody tr:has(.entry-checkbox:checked) {
    background-color: #1c3a5e !important;
}

/* Action buttons */
.col-actions .btn {
    padding: 4px 8px;
    margin: 2px;
}

/* Preview */
.subtitle-preview {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 16px;
    border-radius: 8px;
    font-size: 13px;
    max-height: 300px;
    overflow: auto;
    white-space: pre-wrap;
    font-family: 'Courier New', Courier, monospace;
}

[data-bs-theme="dark"] .subtitle-preview {
    background: #0d1117;
    color: #c9d1d9;
}

/* Modal */
.modal-content {
    border-radius: 12px;
}

[data-bs-theme="dark"] .modal-content {
    background-color: #212529;
    border-color: #495057;
}

/* Responsive */
@media (max-width: 768px) {
    .subtitle-toolbar {
        flex-direction: column;
    }

    .subtitle-toolbar .btn-group {
        width: 100%;
    }

    .subtitle-toolbar .btn-group .btn {
        flex: 1;
    }

    .subtitle-table-wrapper {
        max-height: 400px;
    }

    .col-time {
        width: 120px;
    }

    .time-input {
        font-size: 12px;
        padding: 4px;
    }

    .col-actions {
        width: 80px;
    }

    .col-actions .btn {
        padding: 2px 6px;
    }
}

/* Scrollbar styling */
.subtitle-table-wrapper::-webkit-scrollbar {
    width: 8px;
}

.subtitle-table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.subtitle-table-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.subtitle-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

[data-bs-theme="dark"] .subtitle-table-wrapper::-webkit-scrollbar-track {
    background: #2d3238;
}

[data-bs-theme="dark"] .subtitle-table-wrapper::-webkit-scrollbar-thumb {
    background: #495057;
}

[data-bs-theme="dark"] .subtitle-table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #6c757d;
}
