/* ── YT Transcript Generator Plugin Styles ── */

.yttr-wrap {
    max-width: 780px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 15px;
    color: #1a1a1a;
}

/* ── Form ── */
.yttr-form {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 16px;
}

.yttr-input-row {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.yttr-url-input {
    flex: 1;
    height: 42px;
    padding: 0 14px;
    border: 1px solid #d0d0d0;
    border-radius: 7px;
    font-size: 14px;
    outline: none;
    transition: border-color .15s;
}
.yttr-url-input:focus { border-color: #2563eb; }

.yttr-lang-wrap {
    margin-bottom: 16px;
}

.yttr-label {
    display: block;
    font-size: 13px;
    color: #555;
    margin-bottom: 6px;
}

.yttr-select {
    height: 40px;
    padding: 0 12px;
    border: 1px solid #d0d0d0;
    border-radius: 7px;
    font-size: 14px;
    min-width: 260px;
    background: #fff;
    cursor: pointer;
}

.yttr-action-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* ── Buttons ── */
.yttr-btn {
    height: 40px;
    padding: 0 18px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background .15s, opacity .15s;
    white-space: nowrap;
}

.yttr-btn-primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.yttr-btn-primary:hover:not(:disabled) { background: #1d4ed8; }
.yttr-btn-primary:disabled { opacity: .45; cursor: not-allowed; }

.yttr-btn-secondary {
    background: #f4f4f4;
    color: #333;
    border-color: #d0d0d0;
}
.yttr-btn-secondary:hover { background: #e8e8e8; }

.yttr-btn-ghost {
    background: transparent;
    color: #555;
    border-color: #d0d0d0;
}
.yttr-btn-ghost:hover { background: #f4f4f4; }

/* ── Status messages ── */
.yttr-status {
    padding: 12px 16px;
    border-radius: 7px;
    font-size: 14px;
    margin-bottom: 14px;
}
.yttr-status-loading { background: #eff6ff; color: #1d4ed8; }
.yttr-status-error   { background: #fef2f2; color: #b91c1c; }
.yttr-status-info    { background: #f0fdf4; color: #166534; }

/* ── Result panel ── */
.yttr-result {
    background: #fff;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    overflow: hidden;
}

.yttr-result-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    background: #f8f8f8;
    border-bottom: 1px solid #e2e2e2;
    font-size: 13px;
    color: #555;
    flex-wrap: wrap;
}

.yttr-toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-left: auto;
}
.yttr-toggle-label input { cursor: pointer; }

/* ── Transcript segments ── */
.yttr-transcript-box {
    max-height: 520px;
    overflow-y: auto;
    padding: 16px 18px;
}

.yttr-segment {
    display: flex;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    line-height: 1.55;
}
.yttr-segment:last-child { border-bottom: none; }

.yttr-ts {
    flex-shrink: 0;
    font-size: 12px;
    color: #2563eb;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    padding-top: 2px;
    min-width: 40px;
}

.yttr-text {
    font-size: 14px;
    color: #222;
    flex: 1;
}

/* ── Dark mode support ── */
@media (prefers-color-scheme: dark) {
    .yttr-wrap       { color: #e5e7eb; }
    .yttr-form,
    .yttr-result     { background: #1f2937; border-color: #374151; }
    .yttr-url-input,
    .yttr-select     { background: #111827; border-color: #374151; color: #e5e7eb; }
    .yttr-url-input:focus { border-color: #3b82f6; }
    .yttr-btn-secondary { background: #374151; color: #e5e7eb; border-color: #4b5563; }
    .yttr-btn-ghost  { color: #9ca3af; border-color: #374151; }
    .yttr-btn-ghost:hover { background: #374151; }
    .yttr-result-meta { background: #111827; border-color: #374151; }
    .yttr-segment    { border-color: #374151; }
    .yttr-text       { color: #d1d5db; }
    .yttr-status-loading { background: #1e3a5f; color: #93c5fd; }
    .yttr-status-error   { background: #450a0a; color: #fca5a5; }
    .yttr-status-info    { background: #052e16; color: #86efac; }
}

/* ── Responsive ── */
@media (max-width: 560px) {
    .yttr-input-row { flex-direction: column; }
    .yttr-select    { min-width: unset; width: 100%; }
    .yttr-action-row { flex-direction: column; }
    .yttr-btn       { width: 100%; justify-content: center; }
}
