/*
 * Thumbnail Designer — "Creative Canvas" theme
 * Dedicated stylesheet for ai-tools/thumbnail-designer/index.html
 * Class prefix: thd- | Custom properties: --thd-*
 * Layered on top of the site-wide styles.css (nav/dropdown/marquee only) and Tailwind CDN utilities.
 */

:root {
    --thd-black: #030304;
    --thd-panel: #0b0b0e;
    --thd-panel-alt: #101014;
    --thd-border: rgba(255, 255, 255, 0.08);
    --thd-border-strong: rgba(255, 255, 255, 0.16);
    --thd-red: #dc2626;
    --thd-red-soft: rgba(220, 38, 38, 0.18);
    --thd-text: #f4f4f5;
    --thd-text-dim: #a1a1aa;
    --thd-text-faint: #6b6b72;
    --thd-radius-lg: 28px;
    --thd-radius-md: 20px;
    --thd-radius-sm: 12px;
    --thd-concept-accent: #dc2626;
}

/* ---------- Canvas backdrop ---------- */
.thd-canvas {
    position: relative;
    background:
        radial-gradient(circle at 12% 8%, rgba(220, 38, 38, 0.16), transparent 32%),
        radial-gradient(circle at 88% 18%, rgba(168, 85, 247, 0.14), transparent 30%),
        radial-gradient(circle at 75% 92%, rgba(16, 185, 129, 0.10), transparent 34%),
        radial-gradient(circle at 10% 85%, rgba(59, 130, 246, 0.10), transparent 30%),
        linear-gradient(180deg, #060607 0%, #030304 100%);
}

.thd-dot-grid {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px);
    background-size: 22px 22px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black 40%, transparent 90%);
    pointer-events: none;
}

/* ---------- Eyebrow badge ---------- */
.thd-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    border: 1px solid var(--thd-border-strong);
    background: var(--thd-panel);
    border-radius: 999px;
    padding: 0.45rem 1rem;
    font-size: 0.8rem;
    color: var(--thd-text-dim);
}

.thd-eyebrow-dots {
    display: inline-flex;
    gap: 4px;
}

.thd-eyebrow-dots span {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    display: inline-block;
}
.thd-eyebrow-dots span:nth-child(1) { background: #dc2626; }
.thd-eyebrow-dots span:nth-child(2) { background: #facc15; }
.thd-eyebrow-dots span:nth-child(3) { background: #10b981; }

/* ---------- Layers panel (hero feature list) ---------- */
.thd-layers {
    border: 1px solid var(--thd-border);
    background: var(--thd-panel);
    border-radius: var(--thd-radius-md);
    overflow: hidden;
}

.thd-layer-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 1rem 1.1rem;
    border-bottom: 1px solid var(--thd-border);
}
.thd-layer-row:last-child { border-bottom: none; }

.thd-layer-eye {
    color: var(--thd-red);
    font-size: 0.85rem;
    width: 1.1rem;
    text-align: center;
    flex-shrink: 0;
}

.thd-layer-swatch {
    width: 10px;
    height: 10px;
    border-radius: 3px;
    flex-shrink: 0;
}

.thd-layer-label {
    font-size: 0.72rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--thd-text-faint);
    margin-bottom: 0.15rem;
}

.thd-layer-value {
    font-size: 0.92rem;
    color: var(--thd-text);
    font-weight: 600;
    line-height: 1.35;
}

/* ---------- App window (interactive demo) ---------- */
.thd-app-window {
    position: relative;
    border: 1px solid var(--thd-border-strong);
    background: linear-gradient(180deg, rgba(16, 16, 20, 0.98), rgba(9, 9, 11, 0.98));
    border-radius: var(--thd-radius-lg);
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}

.thd-app-titlebar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 1.2rem;
    background: var(--thd-panel-alt);
    border-bottom: 1px solid var(--thd-border);
}

.thd-app-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.thd-app-dot--red { background: #f87171; }
.thd-app-dot--amber { background: #facc15; }
.thd-app-dot--green { background: #4ade80; }

.thd-app-filename {
    margin-left: 0.5rem;
    font-size: 0.78rem;
    color: var(--thd-text-faint);
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.thd-toolbar {
    display: flex;
    gap: 0.5rem;
    padding: 0.7rem 1.2rem;
    border-bottom: 1px solid var(--thd-border);
    background: rgba(255, 255, 255, 0.015);
}

.thd-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    border: 1px solid var(--thd-border);
    color: var(--thd-text-dim);
    font-size: 0.85rem;
    background: transparent;
}

.thd-tool-btn--active {
    border-color: var(--thd-red);
    color: #fff;
    background: var(--thd-red-soft);
}

.thd-app-body {
    padding: 1.4rem;
}

/* ---------- Fields ---------- */
.thd-field-label {
    display: block;
    font-size: 0.78rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--thd-text-dim);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.thd-input {
    width: 100%;
    border: 1px solid var(--thd-border-strong);
    background: #000;
    border-radius: 14px;
    padding: 0.85rem 1rem;
    font-size: 0.92rem;
    color: var(--thd-text);
}
.thd-input::placeholder { color: var(--thd-text-faint); }
.thd-input:focus {
    outline: none;
    border-color: var(--thd-red);
}

/* ---------- Output panel ---------- */
.thd-output {
    border: 1px solid var(--thd-border);
    background: #000;
    border-radius: var(--thd-radius-md);
    padding: 1.1rem;
    min-height: 320px;
    max-height: 560px;
    overflow-y: auto;
}

.thd-output::-webkit-scrollbar { width: 8px; }
.thd-output::-webkit-scrollbar-track { background: transparent; }
.thd-output::-webkit-scrollbar-thumb {
    background: var(--thd-border-strong);
    border-radius: 999px;
}

.thd-output-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    height: 280px;
    text-align: center;
    color: var(--thd-text-faint);
    font-size: 0.9rem;
    padding: 0 1.5rem;
}
.thd-output-empty i { font-size: 1.6rem; color: var(--thd-border-strong); }

/* ---------- Buttons ---------- */
.thd-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.55rem;
    border-radius: 999px;
    padding: 1rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    transition: filter 0.15s ease, border-color 0.15s ease, color 0.15s ease;
    cursor: pointer;
    border: none;
}

.thd-btn-primary {
    background: linear-gradient(135deg, #ef4444, #b91c1c);
    color: #fff;
    box-shadow: 0 14px 30px rgba(220, 38, 38, 0.28);
}
.thd-btn-primary:hover { filter: brightness(1.08); }

.thd-btn-secondary {
    border: 1px solid var(--thd-border-strong);
    background: rgba(255, 255, 255, 0.02);
    color: var(--thd-text);
}
.thd-btn-secondary:hover { border-color: var(--thd-red); color: #fff; }

/* ---------- Concept cards (generated output) ---------- */
.thd-concept-list {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.thd-concept-card {
    border: 1px solid var(--thd-border);
    border-left: 3px solid var(--thd-concept-accent, var(--thd-red));
    background: var(--thd-panel);
    border-radius: var(--thd-radius-sm);
    padding: 1rem;
}

.thd-concept-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.thd-concept-style {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--thd-text-dim);
    font-weight: 700;
}

.thd-swatches {
    display: flex;
    gap: 6px;
}

.thd-swatch {
    width: 22px;
    height: 22px;
    border-radius: 7px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* ---------- Mock 16:9 thumbnail frame (layout guide, not a render) ---------- */
.thd-frame {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 12px;
    border: 1px dashed var(--thd-border-strong);
    background: linear-gradient(135deg, color-mix(in srgb, var(--thd-concept-accent) 35%, #000) 0%, #050505 75%);
    overflow: hidden;
    margin-bottom: 0.85rem;
}

.thd-frame__subject {
    position: absolute;
    width: 34%;
    aspect-ratio: 1;
    border-radius: 999px;
    border: 2px dashed rgba(255, 255, 255, 0.35);
    left: 8%;
    top: 50%;
    transform: translateY(-50%);
}

.thd-frame__overlay {
    position: absolute;
    right: 6%;
    top: 50%;
    transform: translateY(-50%);
    max-width: 52%;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    text-align: right;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.thd-frame__tag {
    position: absolute;
    left: 8px;
    bottom: 8px;
    font-size: 0.6rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.7);
    background: rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    padding: 0.2rem 0.55rem;
    white-space: nowrap;
}

/* Layout variants — approximate each concept's described composition.
   Illustrative placement only; never an actual generated thumbnail. */
.thd-frame--split {
    background: linear-gradient(90deg, color-mix(in srgb, var(--thd-concept-accent) 45%, #000) 50%, #050505 50%);
}
.thd-frame--split .thd-frame__subject { left: 6%; }
.thd-frame--split .thd-frame__overlay { right: 6%; text-align: right; }

.thd-frame--corner .thd-frame__overlay {
    top: 12%;
    right: 5%;
    transform: none;
}

.thd-frame--text-top .thd-frame__overlay {
    top: 14%;
    right: 6%;
    transform: none;
}
.thd-frame--text-top .thd-frame__subject {
    top: auto;
    bottom: 8%;
    left: 30%;
    transform: none;
}

.thd-frame--text-bottom .thd-frame__overlay {
    top: auto;
    bottom: 12%;
    transform: none;
}

.thd-frame--center .thd-frame__subject {
    left: 50%;
    transform: translate(-50%, -50%);
}
.thd-frame--center .thd-frame__overlay { right: 6%; }

.thd-frame--offcenter .thd-frame__subject { left: 20%; }

.thd-concept-line,
.thd-concept-reason {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--thd-text-dim);
    margin-top: 0.4rem;
    line-height: 1.4;
}
.thd-concept-line i,
.thd-concept-reason i {
    color: var(--thd-concept-accent);
    margin-top: 0.2rem;
    font-size: 0.75rem;
    width: 0.9rem;
    flex-shrink: 0;
}
.thd-concept-reason { color: var(--thd-text-faint); font-size: 0.78rem; }

/* ---------- Style library (static examples) ---------- */
.thd-style-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(2, 1fr);
}

.thd-style-card {
    border: 1px solid var(--thd-border);
    background: #000;
    border-radius: var(--thd-radius-sm);
    padding: 1.1rem;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.thd-style-card:hover {
    transform: translateY(-3px);
    border-color: var(--thd-border-strong);
}

.thd-style-swatches {
    display: flex;
    gap: 5px;
    margin-bottom: 0.75rem;
}
.thd-style-swatches span {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: inline-block;
}

.thd-style-name {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--thd-text-faint);
    margin-bottom: 0.4rem;
}

/* ---------- Workflow steps ---------- */
.thd-step-card {
    border: 1px solid var(--thd-border);
    background: var(--thd-panel);
    border-radius: var(--thd-radius-md);
    padding: 1.75rem;
}

.thd-step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 10px;
    background: var(--thd-red-soft);
    color: var(--thd-red);
    font-weight: 800;
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .thd-style-grid { grid-template-columns: 1fr; }
    .thd-app-body { padding: 1rem; }
    .thd-frame__overlay { font-size: 0.68rem; }
    .thd-swatch { width: 20px; height: 20px; }
}
