/**
 * FCPXML-SRT Wizard - Tool-Specific Styles
 * Namespaced under .fcpxml-srt-wizard
 *
 * DESIGN: Purple accent theme matching FCPX title items
 * This tool uses a vibrant purple color scheme distinct from the
 * monochrome workspace remapper, reflecting its creative subtitle workflow.
 */

/* === Tool-Specific CSS Variables === */
.fcpxml-srt-wizard {
  /* Purple accent theme - matches FCPX title items */
  --wizard-accent: #7b5cb8;
  --wizard-accent-dim: #503585;
  --wizard-accent-hover: #8a6cc4;
  --wizard-accent-glow: rgba(123, 92, 184, 0.25);

  /* Borders with purple hints */
  --wizard-border: #2a2a30;
  --wizard-border-accent: #3d3d45;
  --wizard-border-purple: rgba(123, 92, 184, 0.3);

  /* Backgrounds - slightly different from global for purple theme */
  --wizard-bg-surface: #151518;
  --wizard-bg-elevated: #1c1c21;
  --wizard-bg-hover: #242429;
}

/* === Main Layout === */
.fcpxml-srt-wizard .main-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
}

/* === Drop Zone === */
.fcpxml-srt-wizard .drop-zone {
    border: 2px dashed var(--wizard-border);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--wizard-bg-surface);
    position: relative;
}

.fcpxml-srt-wizard .drop-zone:hover,
.fcpxml-srt-wizard .drop-zone.drag-over {
    border-color: var(--wizard-accent);
    background: var(--wizard-accent-glow);
    box-shadow: 0 0 20px var(--wizard-accent-glow);
}

.fcpxml-srt-wizard .drop-zone.drag-over {
    transform: scale(1.01);
}

.fcpxml-srt-wizard .drop-zone-content {
    pointer-events: none;
}

.fcpxml-srt-wizard .drop-icon {
    color: var(--text-muted);
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.fcpxml-srt-wizard .drop-zone:hover .drop-icon,
.fcpxml-srt-wizard .drop-zone.drag-over .drop-icon {
    color: var(--wizard-accent);
}

.fcpxml-srt-wizard .drop-text {
    font-size: 1.1rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.fcpxml-srt-wizard .drop-text strong {
    color: var(--wizard-accent);
}

.fcpxml-srt-wizard .drop-subtext {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}


.fcpxml-srt-wizard .browse-btn {
    padding: 0.6rem 1.25rem;
    background: var(--wizard-bg-elevated);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    pointer-events: all;
}

.fcpxml-srt-wizard .browse-btn:hover {
    background: var(--wizard-accent-glow);
    border-color: var(--wizard-accent);
    color: var(--wizard-accent);
}


/* === Tool Description === */
.fcpxml-srt-wizard .tool-description {
    text-align: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.fcpxml-srt-wizard .tool-description h1 {
    font-size: 1.5rem;
    line-height: 1.4;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.fcpxml-srt-wizard .tool-description p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

/* === File Info === */
.fcpxml-srt-wizard .file-info {
    margin-top: 1.5rem;
}

.fcpxml-srt-wizard .file-info.hidden {
    display: none;
}

.fcpxml-srt-wizard .file-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--wizard-bg-elevated);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-md);
}

.fcpxml-srt-wizard .file-icon {
    font-size: 1.5rem;
}

.fcpxml-srt-wizard .file-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.fcpxml-srt-wizard .file-type-badge {
    padding: 0.25rem 0.75rem;
    background: var(--wizard-accent);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.fcpxml-srt-wizard .file-type-badge.srt {
    background: var(--success);
}

.fcpxml-srt-wizard .frame-rate-badge {
    padding: 0.25rem 0.75rem;
    background: var(--wizard-bg-surface);
    color: var(--text-secondary);
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    border: 1px solid var(--wizard-border);
}

.fcpxml-srt-wizard .frame-rate-badge.hidden {
    display: none;
}

.fcpxml-srt-wizard .clear-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fcpxml-srt-wizard .clear-btn:hover {
    background: rgba(248, 113, 113, 0.1);
    border-color: var(--error);
    color: var(--error);
}

/* === Frame Rate Selector === */
.fcpxml-srt-wizard .frame-rate-selector {
    margin-top: 1.5rem;
}

.fcpxml-srt-wizard .frame-rate-selector.hidden {
    display: none;
}

.fcpxml-srt-wizard .rate-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.fcpxml-srt-wizard .rate-icon {
    font-size: 1.25rem;
}

.fcpxml-srt-wizard .rate-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--wizard-bg-elevated);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.fcpxml-srt-wizard .rate-select:focus {
    outline: none;
    border-color: var(--wizard-accent);
}

/* === Lane Selector === */
.fcpxml-srt-wizard .lane-selector {
    margin-top: 1.5rem;
}

.fcpxml-srt-wizard .lane-selector.hidden {
    display: none;
}

.fcpxml-srt-wizard .lane-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.fcpxml-srt-wizard .lane-icon {
    font-size: 1.25rem;
}

.fcpxml-srt-wizard .lane-select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--wizard-bg-elevated);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: border-color 0.15s ease;
}

.fcpxml-srt-wizard .lane-select:focus {
    outline: none;
    border-color: var(--wizard-accent);
}

/* === Results Panel === */
.fcpxml-srt-wizard .results-panel {
    margin-top: 2rem;
}

.fcpxml-srt-wizard .results-panel.hidden {
    display: none;
}

.fcpxml-srt-wizard .results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.fcpxml-srt-wizard .results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.fcpxml-srt-wizard .filename-input-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.fcpxml-srt-wizard .filename-label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
}

.fcpxml-srt-wizard .filename-input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    background: var(--wizard-bg-elevated);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: var(--font-mono);
    transition: border-color 0.15s ease;
}

.fcpxml-srt-wizard .filename-input:focus {
    outline: none;
    border-color: var(--wizard-accent);
    background: var(--wizard-bg-hover);
}

.fcpxml-srt-wizard .export-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.fcpxml-srt-wizard .download-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--wizard-accent);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fcpxml-srt-wizard .download-btn:hover {
    background: var(--wizard-accent-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--wizard-accent-glow);
}

.fcpxml-srt-wizard .download-btn-alt {
    background: var(--wizard-bg-elevated);
    color: var(--text-primary);
    border: 1px solid var(--wizard-border);
}

.fcpxml-srt-wizard .download-btn-alt:hover {
    background: var(--wizard-bg-hover);
    border-color: var(--wizard-accent);
}

/* === Gap Tools === */
.fcpxml-srt-wizard .gap-tools {
    margin-bottom: 1.5rem;
    padding: 1.25rem;
    background: var(--wizard-bg-surface);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-md);
}

.fcpxml-srt-wizard .gap-controls {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.fcpxml-srt-wizard .gap-control-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
}

.fcpxml-srt-wizard .gap-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    width: 180px;
    flex-shrink: 0;
}

.fcpxml-srt-wizard .gap-icon {
    font-size: 1.25rem;
}

.fcpxml-srt-wizard .gap-icon.material-icons {
    font-size: 20px;
    vertical-align: middle;
}

.fcpxml-srt-wizard .rate-icon.material-icons {
    font-size: 20px;
    vertical-align: middle;
}

.fcpxml-srt-wizard .threshold-slider-container {
    flex: 1;
    min-width: 200px;
}

.fcpxml-srt-wizard .threshold-slider {
    width: 100%;
    height: 6px;
    background: var(--wizard-border);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.fcpxml-srt-wizard .threshold-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--wizard-accent);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fcpxml-srt-wizard .threshold-slider::-webkit-slider-thumb:hover {
    background: var(--wizard-accent-hover);
    transform: scale(1.2);
}

.fcpxml-srt-wizard .threshold-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--wizard-accent);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fcpxml-srt-wizard .threshold-slider::-moz-range-thumb:hover {
    background: var(--wizard-accent-hover);
    transform: scale(1.2);
}

.fcpxml-srt-wizard .threshold-stops {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;
}

.fcpxml-srt-wizard .threshold-stop {
    font-size: 0.75rem;
    color: var(--text-muted);
    transition: color 0.15s ease;
}

.fcpxml-srt-wizard .threshold-stop.active {
    color: var(--wizard-accent);
    font-weight: 600;
}

.fcpxml-srt-wizard .tool-btn {
    padding: 0.75rem 1.5rem;
    background: transparent;
    border: 1px solid var(--wizard-accent-dim);
    border-radius: var(--radius-sm);
    color: var(--wizard-accent);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
}

.fcpxml-srt-wizard .tool-btn:hover {
    background: var(--wizard-accent-glow);
    border-color: var(--wizard-accent);
}

.fcpxml-srt-wizard .gap-feedback {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    background: rgba(74, 222, 128, 0.1);
    border: 1px solid var(--success);
    border-radius: var(--radius-sm);
    color: var(--success);
    font-size: 0.9rem;
    animation: fadeIn 0.2s ease;
}

.fcpxml-srt-wizard .gap-feedback.hidden {
    display: none;
}

/* === Subtitle Count Header === */
.fcpxml-srt-wizard .subtitle-count-header {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--wizard-border);
}

.fcpxml-srt-wizard .subtitle-count-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* === Subtitle List === */
.fcpxml-srt-wizard .subtitle-list {
    max-height: 500px;
    overflow-y: auto;
    background: var(--wizard-bg-surface);
    border: 1px solid var(--wizard-border);
    border-radius: var(--radius-md);
    padding: 0.5rem;
}

.fcpxml-srt-wizard .subtitle-list::-webkit-scrollbar {
    width: 8px;
}

.fcpxml-srt-wizard .subtitle-list::-webkit-scrollbar-track {
    background: var(--wizard-bg-surface);
    border-radius: 4px;
}

.fcpxml-srt-wizard .subtitle-list::-webkit-scrollbar-thumb {
    background: var(--wizard-border-accent);
    border-radius: 4px;
}

.fcpxml-srt-wizard .subtitle-list::-webkit-scrollbar-thumb:hover {
    background: var(--wizard-accent);
}

.fcpxml-srt-wizard .subtitle-item {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: var(--wizard-bg-elevated);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    transition: background 0.15s ease;
}

.fcpxml-srt-wizard .subtitle-item:hover {
    background: var(--wizard-bg-hover);
}

.fcpxml-srt-wizard .subtitle-item:last-child {
    margin-bottom: 0;
}

.fcpxml-srt-wizard .subtitle-index {
    font-weight: 600;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.fcpxml-srt-wizard .subtitle-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.fcpxml-srt-wizard .subtitle-time {
    font-size: 0.85rem;
    color: var(--wizard-accent);
    font-family: var(--font-mono);
}

.fcpxml-srt-wizard .subtitle-text {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
}

.fcpxml-srt-wizard .subtitle-lane {
    font-size: 0.75rem;
    color: var(--wizard-accent);
    font-weight: 500;
    margin-top: 0.25rem;
}

/* === Error Message === */
.fcpxml-srt-wizard .error-message {
    margin-top: 1.5rem;
    padding: 1rem 1.25rem;
    background: rgba(248, 113, 113, 0.1);
    border: 1px solid var(--error);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.fcpxml-srt-wizard .error-message.hidden {
    display: none;
}

.fcpxml-srt-wizard .error-text {
    color: var(--error);
    font-size: 0.95rem;
}

.fcpxml-srt-wizard .error-close {
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    color: var(--error);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.fcpxml-srt-wizard .error-close:hover {
    background: rgba(248, 113, 113, 0.2);
    border-color: var(--error);
}

/* === Utilities === */
.fcpxml-srt-wizard .hidden {
    display: none !important;
}

/* === Animations === */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* === Responsive === */
@media (max-width: 640px) {
    .fcpxml-srt-wizard .main-content {
        padding: 2rem 1rem;
    }

    .fcpxml-srt-wizard .drop-zone {
        padding: 2rem 1rem;
    }

    .fcpxml-srt-wizard .results-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .fcpxml-srt-wizard .export-buttons {
        width: 100%;
    }

    .fcpxml-srt-wizard .download-btn {
        flex: 1;
    }

    .fcpxml-srt-wizard .gap-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .fcpxml-srt-wizard .tool-btn {
        width: 100%;
    }

    .fcpxml-srt-wizard .subtitle-item {
        grid-template-columns: 40px 1fr;
        gap: 0.75rem;
        padding: 0.75rem;
    }
}
