/* ============================================================
   Minimal monospace indirme arayüzü — siyah/beyaz, tek şerit,
   orijinal maskot illüstrasyonu
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
    --bg: #fdfdfb;
    --ink: #121212;
    --muted: #8c8c86;
    --muted-dim: #b7b5ac;
    --line: #e6e4dc;
    --line-strong: #d3d1c6;
    --accent: #ff8a1f;
    --accent-strong: #d6440f;
    --danger: #c0293b;
    --danger-bg: #fdecee;
    --danger-border: #f1c4c9;
    --focus: rgba(214, 68, 15, 0.18);
    --rail-w: 76px;
}

:root[data-theme="dark"] {
    --bg: #131313;
    --ink: #f1efe9;
    --muted: #9b9a92;
    --muted-dim: #6c6b63;
    --line: rgba(241, 239, 233, 0.12);
    --line-strong: rgba(241, 239, 233, 0.22);
    --danger: #ff8f7d;
    --danger-bg: rgba(255, 108, 84, 0.14);
    --danger-border: rgba(255, 108, 84, 0.4);
    --focus: rgba(255, 138, 31, 0.24);
}

* {
    box-sizing: border-box;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

html, body {
    height: 100%;
}

body {
    margin: 0;
    min-width: 320px;
    color: var(--ink);
    background: var(--bg);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    -webkit-font-smoothing: antialiased;
}

button, input {
    font: inherit;
}

/* Sol ikon şeridi */
.rail {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--rail-w);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 22px 0;
    border-right: 1px solid var(--line);
    z-index: 5;
}

.rail-mark {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--accent-strong);
    text-decoration: none;
}

.rail-bottom {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
}

.rail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    border: 0;
    background: none;
    color: var(--muted);
    font-family: inherit;
    font-size: 10.5px;
    cursor: pointer;
    padding: 4px;
}

.rail-item svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

.rail-item:hover {
    color: var(--accent-strong);
}

.terms-link {
    color: var(--muted);
    font-family: inherit;
    font-size: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.terms-link:hover {
    color: var(--accent-strong);
}

/* Sağ üst köşe: formu sıfırla */
.corner-reset {
    position: fixed;
    top: 20px;
    right: 24px;
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 50%;
    background: var(--bg);
    color: var(--muted);
    cursor: pointer;
    z-index: 5;
}

.corner-reset svg {
    width: 15px;
    height: 15px;
    stroke: currentColor;
}

.corner-reset:hover {
    color: var(--accent-strong);
    border-color: var(--accent-strong);
}

.history-wrap {
    position: fixed;
    top: 20px;
    right: 24px;
    z-index: 6;
}

.history-panel {
    position: absolute;
    top: 44px;
    right: 0;
    width: 300px;
    max-height: 340px;
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--bg);
    box-shadow: 0 16px 34px rgba(18, 18, 18, 0.12);
    overflow-y: auto;
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 11px;
}

.history-head button {
    border: 0;
    background: none;
    padding: 0;
    color: var(--muted);
    font-family: inherit;
    font-size: 11px;
    text-decoration: underline;
    cursor: pointer;
}

.history-head button:hover {
    color: var(--accent-strong);
}

#gecmisListe {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

#gecmisListe li {
    display: block;
}

#gecmisListe button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: none;
    color: var(--ink);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

#gecmisListe button:hover {
    border-color: var(--accent-strong);
}

.history-item-url {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11.5px;
}

.history-item-meta {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 10px;
}

.history-empty {
    margin: 6px 0 2px;
    color: var(--muted-dim);
    font-size: 11.5px;
    text-align: center;
}

/* Sahne: dikey ortalanmış tek sütun */
.stage {
    min-height: 100vh;
    padding: 90px 32px 70px calc(var(--rail-w) + 32px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
}

.platforms-pill {
    margin-bottom: 46px;
}

.platforms-pill summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 999px;
    color: var(--muted);
    font-size: 12.5px;
    cursor: pointer;
    list-style: none;
}

.platforms-pill summary::-webkit-details-marker {
    display: none;
}

.platforms-pill summary:hover {
    color: var(--accent-strong);
    border-color: var(--accent-strong);
}

.platforms-pill[open] summary {
    color: var(--accent-strong);
    border-color: var(--accent-strong);
}

.platforms-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 9px;
    margin-top: 14px;
    max-width: 760px;
}

/* Platform SEO linkleri: ham tarayıcı linki görünümünü kaldır,
   mevcut minimalist tasarıma uygun küçük kartlara dönüştür. */
.platforms-list a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 13px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--bg);
    color: var(--muted);
    font-size: 11.5px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.platforms-list a::before {
    content: '↗';
    display: inline-grid;
    place-items: center;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    border: 1px solid var(--line-strong);
    color: var(--accent-strong);
    font-size: 10px;
    line-height: 1;
}

.platforms-list a:hover,
.platforms-list a:focus-visible {
    color: var(--accent-strong);
    border-color: var(--accent);
    background: rgba(255, 138, 31, 0.06);
    transform: translateY(-1px);
    box-shadow: 0 5px 18px rgba(18, 18, 18, 0.06);
    outline: none;
}

.platforms-list a:focus-visible {
    box-shadow: 0 0 0 3px var(--focus);
}

.mascot {
    width: 148px;
    height: auto;
    margin-bottom: 38px;
}

h1 {
    margin: 0 0 34px;
    font-size: 13.5px;
    font-weight: 500;
    color: var(--muted);
    max-width: 48ch;
    line-height: 1.6;
}

.error {
    width: min(580px, 100%);
    margin: 0 0 22px;
    padding: 12px 14px;
    border: 1px solid var(--danger-border);
    border-radius: 10px;
    color: var(--danger);
    background: var(--danger-bg);
    font-size: 12.5px;
    line-height: 1.55;
    text-align: left;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

form {
    width: min(580px, 100%);
}

.url-row {
    position: relative;
}

.url-row svg {
    position: absolute;
    top: 50%;
    left: 16px;
    transform: translateY(-50%);
    width: 15px;
    height: 15px;
    stroke: var(--muted);
    pointer-events: none;
}

#url {
    width: 100%;
    height: 52px;
    padding: 0 16px 0 40px;
    border: 1.5px solid var(--accent-strong);
    border-radius: 12px;
    outline: 0;
    color: var(--ink);
    background: var(--bg);
    font-size: 13.5px;
    transition: box-shadow 0.15s ease;
}

#url:focus {
    box-shadow: 0 0 0 4px var(--focus);
}

#url::placeholder {
    color: var(--muted-dim);
}

.controls-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 14px;
}

.format-pill {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
}

.format-key {
    position: relative;
}

.format-key input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.format-key span {
    display: flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 16px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    transition: background 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}

.format-key svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

.format-key input:checked + span {
    background: var(--accent-strong);
    color: #fff;
}

.format-key input:focus-visible + span {
    box-shadow: 0 0 0 3px var(--focus);
}

.paste-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    background: var(--bg);
    color: var(--muted);
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
}

.paste-btn svg {
    width: 13px;
    height: 13px;
    stroke: currentColor;
}

.paste-btn:hover {
    color: var(--accent-strong);
    border-color: var(--accent-strong);
}

.quality-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
}

.quality-row label {
    flex-shrink: 0;
    color: var(--muted);
    font-size: 11px;
}

.quality-row select {
    height: 38px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: 8px;
    color: var(--ink);
    background: var(--bg);
    font-size: 12px;
}

.quality-row select:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px var(--focus);
}

.advanced {
    margin-top: 14px;
    text-align: left;
}

.advanced summary {
    color: var(--muted);
    font-size: 12px;
    cursor: pointer;
    list-style: none;
}

.advanced summary::-webkit-details-marker {
    display: none;
}

.advanced summary:hover {
    color: var(--accent-strong);
}

.advanced-body {
    margin-top: 10px;
}

.advanced label {
    display: block;
    margin-bottom: 6px;
    color: var(--muted);
    font-size: 11px;
}

.filename-input-wrap {
    position: relative;
}

#dosya_adi {
    width: 100%;
    height: 44px;
    padding: 0 58px 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    outline: 0;
    color: var(--ink);
    background: var(--bg);
    font-size: 12.5px;
}

#dosya_adi:focus {
    border-color: var(--accent-strong);
    box-shadow: 0 0 0 3px var(--focus);
}

.extension {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 11px;
    pointer-events: none;
}

.cta {
    width: 100%;
    height: 52px;
    margin-top: 18px;
    border: 0;
    border-radius: 12px;
    background: var(--accent-strong);
    color: #fff;
    font-family: inherit;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}

.cta:hover {
    background: #b93a0c;
    transform: translateY(-1px);
}

.cta:disabled {
    opacity: 0.55;
    cursor: wait;
    transform: none;
}

.terms {
    margin: 28px 0 0;
    color: var(--muted-dim);
    font-size: 11px;
}

.terms a {
    color: var(--muted);
}

.terms a:hover {
    color: var(--accent-strong);
}

/* Token tabanlı önizleme sayfası (yeni sekmede açılır) — sol şerit yok,
   bu yüzden .stage'den ayrı, kendi ortalama düzenine sahip. */
.preview-stage {
    min-height: 100vh;
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 0;
}

.preview-name {
    max-width: min(560px, 92vw);
    margin: 0 0 16px;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-size: 12.5px;
}

.preview-player {
    display: block;
    max-width: min(560px, 92vw);
    max-height: 76vh;
    width: auto;
    height: auto;
    margin-bottom: 20px;
    border-radius: 12px;
    background: #000;
}

.preview-player-audio {
    width: min(480px, 92vw);
    margin-bottom: 20px;
}

.preview-image {
    display: block;
    max-width: min(560px, 92vw);
    max-height: 76vh;
    width: auto;
    height: auto;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid var(--line-strong);
}


.preview-error {
    max-width: min(560px, 92vw);
    margin: -6px 0 16px;
    color: #c4421a;
    font-size: 12px;
    line-height: 1.5;
}

.preview-download {
    width: min(260px, 92vw);
}

@media (max-width: 480px) {
    .preview-player {
        max-height: 64vh;
    }
}

@media (max-width: 620px) {
    .rail {
        width: 56px;
    }

    .stage {
        padding-left: calc(56px + 14px);
        padding-right: 14px;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
    }

    .format-pill {
        justify-content: center;
    }

    .paste-btn {
        justify-content: center;
    }
}

/* Önizleme indirme yönlendirmesi: mevcut tipografi ve renk sistemi korunur. */
.preview-quality,
.preview-download-help {
    margin: 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.55;
    text-align: center;
}

.preview-quality {
    margin-top: -4px;
}

.preview-download-help {
    max-width: 420px;
    margin-top: -8px;
}

/* ============================================================
   RESPONSIVE — tablet / mobile
   Mevcut masaüstü tasarımı korunur; küçük ekranlarda tüm
   sabit genişlikler ve yatay kontroller akışkan hale getirilir.
   ============================================================ */

@media (max-width: 900px) {
    :root {
        --rail-w: 0px;
    }

    .rail {
        width: 100%;
        height: 58px;
        bottom: auto;
        right: 0;
        padding: 0 18px;
        flex-direction: row;
        justify-content: space-between;
        border-right: 0;
        border-bottom: 1px solid var(--line);
        background: var(--bg);
    }

    .rail-mark {
        font-size: 18px;
    }

    .rail-bottom {
        margin-top: 0;
        margin-left: auto;
        flex-direction: row;
        gap: 8px;
    }

    .rail-item {
        min-width: 48px;
        padding: 6px 7px;
    }

    .rail-item span {
        font-size: 9px;
    }

    @media (max-width: 640px) {
    body {
        overflow-x: hidden;
    }

    .rail {
        padding: 0 12px;
    }

    .rail-bottom {
        gap: 2px;
    }

    .rail-item {
        min-width: 44px;
        padding: 5px 6px;
    }

    .rail-item svg {
        width: 17px;
        height: 17px;
    }

    .rail-item span {
        display: none;
    }

    .history-wrap {
        top: 68px;
        right: 12px;
    }

    .corner-reset {
        position: static;
        width: 36px;
        height: 36px;
    }

    .history-panel {
        top: 44px;
        right: 0;
        width: min(310px, calc(100vw - 24px));
    }

    .stage {
        min-height: auto;
        padding: 112px 16px 44px;
        justify-content: flex-start;
    }

    .platforms-pill {
        margin-bottom: 28px;
        max-width: 100%;
    }

    .platforms-pill summary {
        max-width: 100%;
        padding: 8px 12px;
        font-size: 11px;
        white-space: nowrap;
    }

    .platforms-list {
        gap: 7px;
        margin-top: 10px;
    }

    .platforms-list a {
        min-height: 32px;
        padding: 7px 10px;
        font-size: 10px;
    }

    .platforms-list a::before {
        width: 15px;
        height: 15px;
        font-size: 9px;
    }

    .mascot {
        width: 108px;
        margin-bottom: 24px;
    }

    h1 {
        width: min(100%, 520px);
        margin-bottom: 24px;
        padding: 0 4px;
        font-size: 12px;
        line-height: 1.65;
    }

    .error {
        margin-bottom: 16px;
        padding: 10px 12px;
        font-size: 11.5px;
    }

    #url {
        height: 50px;
        padding-right: 12px;
        font-size: 12px;
    }

    .controls-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .format-pill {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .format-key span {
        justify-content: center;
        height: 40px;
        padding: 0 5px;
        gap: 4px;
        font-size: 10px;
    }

    .format-key svg {
        width: 12px;
        height: 12px;
    }

    .paste-btn {
        width: 100%;
        justify-content: center;
        height: 42px;
    }

    .quality-row {
        display: grid;
        grid-template-columns: auto 1fr;
        align-items: center;
    }

    .quality-row select {
        width: 100%;
    }

    .advanced {
        margin-top: 12px;
    }

    .cta {
        height: 50px;
        margin-top: 16px;
        font-size: 12px;
    }

    .terms {
        width: min(100%, 420px);
        padding: 0 8px;
        line-height: 1.6;
        font-size: 10px;
    }
}

@media (max-width: 390px) {
    .rail {
        padding: 0 8px;
    }

    .rail-mark {
        font-size: 16px;
    }

    .rail-bottom {
        gap: 0;
    }

    .rail-item {
        min-width: 40px;
        padding-inline: 4px;
    }

    .stage {
        padding-inline: 12px;
    }

    .platforms-pill summary {
        font-size: 10px;
    }

    .mascot {
        width: 94px;
    }

    h1 {
        font-size: 11px;
    }

    .format-key span {
        font-size: 9px;
        padding-inline: 2px;
    }

    .format-key svg {
        display: none;
    }

    #url {
        font-size: 11px;
    }
}
