/*
 * YouTube to Blog - Plugin Stylesheet
 * White background | Black text | YouTube Red (#FF0000) accents
 * No dark mode
 */

/* ── Reset / Scope ─────────────────────────────────────────────────────────── */
#yttb-wrap,
#yttb-wrap * {
    box-sizing: border-box;
    color-scheme: light !important;
}

#yttb-wrap {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #111111;
    background: #ffffff;
    max-width: 860px;
    margin: 0 auto;
    padding: 0;
}

/* ── Description ───────────────────────────────────────────────────────────── */
.yttb-description {
    margin-bottom: 28px;
}

.yttb-description p,
.yttb-description ol {
    color: #333333;
    margin: 0 0 12px;
}

.yttb-description ol {
    padding-left: 22px;
}

.yttb-description li {
    margin-bottom: 6px;
}

#yttb-wrap a {
    color: #FF0000;
    text-decoration: none;
    font-weight: 500;
}

#yttb-wrap a:hover {
    text-decoration: underline;
    color: #cc0000;
}

.yttb-note {
    background: #fff5f5;
    border-left: 3px solid #FF0000;
    padding: 10px 14px;
    border-radius: 0 6px 6px 0;
    font-size: 13px;
    color: #444444;
    margin: 0;
}

/* ── Form Card ─────────────────────────────────────────────────────────────── */
.yttb-form-card {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.yttb-field-row {
    margin-bottom: 20px;
}

.yttb-field-row label {
    display: block;
    font-weight: 700;
    font-size: 12px;
    color: #111111;
    margin-bottom: 7px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Input wrapper for password toggle */
.yttb-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.yttb-input-wrap input {
    flex: 1;
    padding-right: 44px !important;
}

#yttb-toggle-key {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #888888;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    box-shadow: none;
    outline: none;
}

#yttb-toggle-key:hover {
    color: #FF0000;
}

/* All text inputs */
#yttb-wrap input[type="password"],
#yttb-wrap input[type="url"],
#yttb-wrap input[type="text"] {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #cccccc;
    border-radius: 7px;
    font-size: 14px;
    color: #111111;
    background: #ffffff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

#yttb-wrap input[type="password"]:focus,
#yttb-wrap input[type="url"]:focus,
#yttb-wrap input[type="text"]:focus {
    border-color: #FF0000;
    box-shadow: 0 0 0 3px rgba(255,0,0,0.10);
}

.yttb-field-hint {
    font-size: 12px;
    color: #777777;
    margin: 6px 0 0;
}

.yttb-actions {
    display: flex;
    gap: 12px;
    margin-top: 6px;
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.yttb-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #FF0000;
    color: #ffffff !important;
    border: none;
    border-radius: 7px;
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none !important;
    line-height: 1.4;
}

.yttb-btn-primary:hover {
    background: #cc0000;
    color: #ffffff !important;
    transform: translateY(-1px);
    text-decoration: none !important;
}

.yttb-btn-primary:active {
    transform: translateY(0);
}

.yttb-btn-primary:disabled {
    background: #ffaaaa;
    cursor: not-allowed;
    transform: none;
}

.yttb-btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #ffffff;
    color: #FF0000 !important;
    border: 1.5px solid #FF0000;
    border-radius: 7px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    text-decoration: none !important;
    line-height: 1.4;
}

.yttb-btn-outline:hover {
    background: #FF0000;
    color: #ffffff !important;
    text-decoration: none !important;
}

.yttb-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #555555 !important;
    border: 1.5px solid #dddddd;
    border-radius: 7px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none !important;
    line-height: 1.4;
}

.yttb-btn-ghost:hover {
    border-color: #FF0000;
    color: #FF0000 !important;
    text-decoration: none !important;
}

/* ── Progress ──────────────────────────────────────────────────────────────── */
.yttb-progress {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    padding: 28px 32px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

.yttb-progress-inner {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
}

.yttb-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f0f0f0;
    border-top-color: #FF0000;
    border-radius: 50%;
    animation: yttb-spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.yttb-progress-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

#yttb-progress-label {
    font-weight: 600;
    font-size: 15px;
    color: #111111;
}

#yttb-progress-sub {
    font-size: 13px;
    color: #777777;
}

.yttb-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.yttb-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 7px;
    background: #f9f9f9;
    border: 1px solid #eeeeee;
    font-size: 14px;
    color: #999999;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
}

.yttb-step.yttb-step-active {
    background: #fff5f5;
    border-color: #FF0000;
    color: #111111;
    font-weight: 600;
}

.yttb-step.yttb-step-done {
    background: #f5fff8;
    border-color: #22aa55;
    color: #22aa55;
}

.yttb-step-icon {
    font-size: 16px;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

/* ── Error ─────────────────────────────────────────────────────────────────── */
.yttb-error {
    background: #fff5f5;
    border: 1px solid #ffcccc;
    border-left: 4px solid #FF0000;
    border-radius: 8px;
    padding: 18px 22px;
    margin-bottom: 24px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}

.yttb-error-inner {
    flex: 1;
    min-width: 200px;
}

.yttb-error strong {
    color: #cc0000;
    display: block;
    margin-bottom: 4px;
}

#yttb-error-msg {
    color: #333333;
    font-size: 14px;
}

/* ── Result ────────────────────────────────────────────────────────────────── */
.yttb-result {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
    margin-bottom: 24px;
}

.yttb-result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid #eeeeee;
    background: #fafafa;
    padding: 16px 24px;
}

.yttb-meta-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-right: 32px;
    margin-bottom: 8px;
}

.yttb-meta-full {
    width: 100%;
    margin-right: 0;
}

.yttb-meta-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #888888;
}

.yttb-meta-value {
    font-size: 14px;
    color: #111111;
    font-weight: 500;
}

.yttb-badge {
    display: inline-block;
    background: #fff0f0;
    color: #FF0000;
    border: 1px solid #ffcccc;
    border-radius: 20px;
    padding: 2px 12px;
    font-size: 13px;
    font-weight: 600;
}

.yttb-result-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px 24px;
    border-bottom: 1px solid #eeeeee;
    background: #ffffff;
}

/* ── Tabs ──────────────────────────────────────────────────────────────────── */
.yttb-tabs {
    display: flex;
    border-bottom: 1px solid #eeeeee;
    background: #fafafa;
}

.yttb-tab {
    padding: 12px 22px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 14px;
    font-weight: 500;
    color: #777777;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    line-height: 1.4;
}

.yttb-tab:hover {
    color: #FF0000;
}

.yttb-tab.yttb-tab-active {
    color: #FF0000;
    border-bottom-color: #FF0000;
    font-weight: 700;
}

.yttb-tab-panel {
    padding: 28px 32px;
}

/* ── Blog Preview ──────────────────────────────────────────────────────────── */
.yttb-blog-preview {
    background: #ffffff;
    color: #111111;
}

.yttb-blog-preview h1 {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.25;
    color: #111111;
    margin: 0 0 20px;
}

.yttb-blog-preview h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111111;
    margin: 32px 0 12px;
    padding-bottom: 6px;
    border-bottom: 2px solid #FF0000;
}

.yttb-blog-preview h3 {
    font-size: 18px;
    font-weight: 700;
    color: #111111;
    margin: 24px 0 10px;
}

.yttb-blog-preview p {
    color: #333333;
    margin: 0 0 16px;
    line-height: 1.75;
}

.yttb-blog-preview ul,
.yttb-blog-preview ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.yttb-blog-preview li {
    margin-bottom: 8px;
    color: #333333;
    line-height: 1.65;
}

.yttb-blog-preview strong {
    color: #111111;
    font-weight: 700;
}

.yttb-blog-preview a {
    color: #FF0000;
}

/* ── HTML Source ───────────────────────────────────────────────────────────── */
#yttb-html-source {
    width: 100%;
    min-height: 320px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 12px;
    line-height: 1.6;
    color: #111111;
    background: #f8f8f8;
    border: 1px solid #dddddd;
    border-radius: 6px;
    padding: 14px;
    resize: vertical;
    outline: none;
}

/* ── Draft Notice ──────────────────────────────────────────────────────────── */
.yttb-draft-notice {
    background: #f0fff4;
    border-top: 1px solid #bbf0cc;
    padding: 14px 24px;
    font-size: 14px;
    color: #1a7a3a;
    font-weight: 500;
}

.yttb-draft-notice a {
    color: #FF0000;
    font-weight: 600;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .yttb-form-card,
    .yttb-progress,
    .yttb-tab-panel {
        padding: 20px 18px;
    }

    .yttb-result-toolbar,
    .yttb-result-meta {
        padding: 14px 18px;
    }

    .yttb-btn-primary,
    .yttb-btn-outline,
    .yttb-btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .yttb-actions,
    .yttb-result-toolbar {
        flex-direction: column;
    }
}
