/* YouTube Thumbnail Tester - dropzone, upload cards, mock YouTube
 * surfaces (light + dark), the measurer modal, on top of shared
 * tools.css. Mock type uses a Roboto-first stack to match YouTube. */

.ytt-intro { margin: 0 0 14px; color: #4b5563; font-size: 0.95rem; }

/* ---- Dropzone ---- */
.ytt-dropzone {
    border: 2px dashed #d3d7dc;
    border-radius: 12px;
    padding: 26px 16px;
    text-align: center;
    cursor: pointer;
    background: #fafbfc;
    transition: border-color 0.15s, background 0.15s;
}
.ytt-dropzone:hover, .ytt-dropzone.is-drag { border-color: #cc0000; background: #fdf6f6; }
.ytt-dz-icon { color: #cc0000; margin-bottom: 6px; }
.ytt-dz-text { font-weight: 600; color: #1f2937; }
.ytt-dz-sub { font-size: 0.82rem; color: #6b7280; margin-top: 4px; }
.ytt-dropzone input[type="file"] { display: none; }

/* ---- Fields ---- */
.ytt-fields { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.ytt-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 260px; }
.ytt-field-narrow { flex: 0 1 180px; }
.ytt-label { font-size: 0.8rem; font-weight: 600; color: #374151; }
.ytt-text { flex: 0 0 auto; }

/* ---- Upload cards ---- */
.ytt-cards { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.ytt-card {
    display: flex;
    gap: 12px;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    padding: 10px;
    background: #fff;
    flex: 1 1 320px;
    max-width: 460px;
}
.ytt-card-thumb { position: relative; width: 128px; height: 72px; border-radius: 8px; overflow: hidden; flex: 0 0 auto; background: #eef0f3; }
.ytt-card-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ytt-card-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.ytt-card-name { font-weight: 600; font-size: 0.86rem; color: #1f2937; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ytt-card-meta { font-size: 0.78rem; color: #6b7280; }
.ytt-card-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.ytt-check { font-size: 0.72rem; padding: 2px 8px; border-radius: 999px; font-weight: 600; }
.ytt-check.is-ok { background: #ecfdf5; color: #047857; }
.ytt-check.is-warn { background: #fff7ed; color: #b45309; }
.ytt-card-actions { display: flex; gap: 8px; margin-top: 2px; }
.ytt-small-btn { padding: 4px 10px; font-size: 0.78rem; }

/* ---- Chips shared by tiles ---- */
.ytt-chip {
    position: absolute;
    top: 6px;
    left: 6px;
    background: #cc0000;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 6px;
}

/* ---- Surfaces section ---- */
.ytt-surfaces {
    margin: 18px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 16px 18px;
}
.ytt-surfaces[hidden] { display: none; }
.ytt-controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.ytt-pills { display: flex; flex-wrap: wrap; gap: 6px; }
.ytt-pill {
    border: 1px solid #d7dbe0;
    background: #fff;
    color: #374151;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
}
.ytt-pill.is-active { background: #cc0000; border-color: #cc0000; color: #fff; }
.ytt-side-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ytt-theme-toggle { font-size: 0.85rem; color: #334155; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.ytt-stage-wrap { overflow-x: auto; padding-bottom: 4px; }
.ytt-stage-note { margin: 10px 0 0; font-size: 0.82rem; color: #64748b; }

/* ---- Mock canvas ---- */
.ytt-mock {
    --yt-bg: #ffffff;
    --yt-text: #0f0f0f;
    --yt-meta: #606060;
    --yt-ph: #e5e5e5;
    --yt-bar: #e5e5e5;
    background: var(--yt-bg);
    border-radius: 12px;
    padding: 18px;
    font-family: Roboto, "Segoe UI", Arial, sans-serif;
    min-width: min-content;
}
.ytt-mock.ytt-dark {
    --yt-bg: #0f0f0f;
    --yt-text: #f1f1f1;
    --yt-meta: #aaaaaa;
    --yt-ph: #272727;
    --yt-bar: #303030;
}
.ytt-thumb { position: relative; overflow: hidden; background: var(--yt-ph); flex: 0 0 auto; }
.ytt-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ytt-duration {
    position: absolute;
    right: 6px;
    bottom: 6px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    padding: 2px 5px;
    border-radius: 4px;
    line-height: 1.2;
}
.ytt-avatar {
    border-radius: 50%;
    background: #7a7a7a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    flex: 0 0 auto;
}
.ytt-avatar-ph { background: var(--yt-ph); }
.ytt-bars { display: flex; flex-direction: column; gap: 7px; margin-top: 3px; }
.ytt-bar { height: 12px; border-radius: 6px; background: var(--yt-bar); }
.ytt-bars-meta .ytt-bar { height: 9px; }
.ytt-bars-desc { margin-top: 10px; }
.ytt-bars-desc .ytt-bar { height: 8px; }
.ytt-meta { color: var(--yt-meta); font-size: 14px; line-height: 1.45; }
.ytt-meta-sm { font-size: 12px; }

/* home grid */
.ytt-home-grid { display: grid; grid-template-columns: repeat(3, 360px); gap: 24px 16px; }
.ytt-tile-home { width: 360px; }
.ytt-tile-row { display: flex; gap: 12px; margin-top: 10px; }
.ytt-tile-col { min-width: 0; flex: 1 1 auto; }
.ytt-title-lg {
    color: var(--yt-text);
    font-size: 16px;
    font-weight: 500;
    line-height: 22px;
    max-height: 44px;
    overflow: hidden;
    margin-bottom: 3px;
}
/* search */
.ytt-search-list { display: flex; flex-direction: column; gap: 20px; max-width: 760px; }
.ytt-row-search { display: flex; gap: 16px; }
.ytt-search-col { min-width: 0; flex: 1 1 auto; }
.ytt-title-search { color: var(--yt-text); font-size: 18px; font-weight: 400; line-height: 26px; max-height: 52px; overflow: hidden; margin-bottom: 4px; }
.ytt-search-channel { display: flex; align-items: center; gap: 8px; margin: 8px 0 2px; }
/* sidebar */
.ytt-side-list { display: flex; flex-direction: column; gap: 8px; max-width: 402px; }
.ytt-row-side { display: flex; gap: 8px; }
.ytt-side-col { min-width: 0; flex: 1 1 auto; }
.ytt-title-side { color: var(--yt-text); font-size: 14px; font-weight: 500; line-height: 20px; max-height: 40px; overflow: hidden; margin-bottom: 3px; }
/* mobile */
.ytt-phone-row-wrap { display: flex; gap: 24px; align-items: flex-start; }
.ytt-phone { width: 375px; border: 1px solid rgba(128, 128, 128, 0.35); border-radius: 18px; overflow: hidden; flex: 0 0 auto; background: var(--yt-bg); }
.ytt-phone-top { color: var(--yt-text); font-weight: 700; font-size: 16px; padding: 10px 14px; letter-spacing: -0.02em; }
.ytt-phone-tile { margin-bottom: 6px; }
.ytt-phone-row { padding: 0 12px 10px; }
.ytt-title-mob { color: var(--yt-text); font-size: 14px; font-weight: 500; line-height: 20px; max-height: 40px; overflow: hidden; margin-bottom: 2px; }
/* shorts */
.ytt-shorts-shelf { display: flex; gap: 12px; align-items: flex-start; }
.ytt-tile-shorts { width: 158px; flex: 0 0 auto; }
.ytt-title-shorts { color: var(--yt-text); font-size: 14px; font-weight: 500; line-height: 20px; max-height: 40px; overflow: hidden; margin-top: 8px; }
.ytt-tile-shorts .ytt-bars { margin-top: 10px; }

/* ---- Measurer modal ---- */
.ytt-measure-hint { margin: 0 0 10px; font-size: 0.86rem; color: #4b5563; }
.ytt-measure-stage { max-height: 56vh; overflow: auto; border-radius: 8px; background: #f3f4f6; }
#ytt-measure-canvas { display: block; width: 100%; height: auto; cursor: crosshair; touch-action: none; }
.ytt-measure-readout { margin: 10px 0 0; font-size: 0.88rem; font-weight: 600; color: #4b5563; }
.ytt-measure-readout.is-ok { color: #047857; }
.ytt-measure-readout.is-warn { color: #b45309; }

@media (max-width: 640px) {
    .ytt-card { max-width: none; }
    .ytt-controls { flex-direction: column; align-items: flex-start; }
    .ytt-mock { padding: 12px; }
}
