/* ═══════════════════════════════════════════════════════════════
   Mei — Y7cdn Upload Frontend
   Flat dark minimal · no shadows · clean
   ═══════════════════════════════════════════════════════════════ */

@font-face {
    font-family: 'Geist';
    src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist';
    src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-Medium.woff2') format('woff2');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist';
    src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Geist';
    src: url('https://cdn.jsdelivr.net/npm/geist@1.3.1/dist/fonts/geist-sans/Geist-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { height: 100%; }

body {
    min-height: 100vh;
    font-family: 'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #0A0A0E;
    color: #7A80A8;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Page layout ────────────────────────────────────────────── */
.page {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0 24px;
}

.content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-width: 560px;
    padding: 52px 0 40px;
}

/* ═══════════════════════════════════════════════════════════════
   Header
   ═══════════════════════════════════════════════════════════════ */
.header {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin-bottom: 28px;
    user-select: none;
}

.mei-sit {
    width: 80px;
    height: auto;
    transform: scaleX(-1);
    pointer-events: none;
    margin-right: -4px;
    margin-bottom: -4px;
    opacity: 0.9;
    flex-shrink: 0;
}

.title {
    font-size: 36px;
    font-weight: 700;
    color: #C8CBDF;
    letter-spacing: 0;
    line-height: 1;
}

/* ═══════════════════════════════════════════════════════════════
   Upload box
   ═══════════════════════════════════════════════════════════════ */
.upload-box {
    width: 100%;
    border: 1px solid #1E1F2E;
    border-radius: 12px;
    background: #0E0F14;
    cursor: pointer;
    outline: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 56px 24px;
    transition: border-color 0.25s, background 0.25s;
}

.upload-box:hover {
    border-color: #2E3048;
    background: #101118;
}

.upload-box:focus-visible {
    border-color: #A62C3B;
}

.upload-box.drag-over {
    border-color: #A62C3B;
    background: #11121A;
}

.upload-icon {
    margin-bottom: 16px;
}

.upload-icon svg {
    width: 40px;
    height: 40px;
    color: #2E3048;
    transition: color 0.25s;
}

.upload-box:hover .upload-icon svg {
    color: #4A4F70;
}

.upload-box.drag-over .upload-icon svg {
    color: #A62C3B;
}

.upload-label {
    font-size: 18px;
    font-weight: 600;
    color: #5A5F80;
    transition: color 0.25s;
}

.upload-box:hover .upload-label {
    color: #8A90B0;
}

.upload-box.drag-over .upload-label {
    color: #C8CBDF;
}

.upload-limit {
    font-size: 13px;
    font-weight: 400;
    color: #3A3D58;
    margin-top: 6px;
}

/* ═══════════════════════════════════════════════════════════════
   Info (disclaimer + links) — below upload box
   ═══════════════════════════════════════════════════════════════ */
.info {
    margin-top: 18px;
    text-align: center;
}

.disclaimer {
    font-size: 13px;
    font-weight: 400;
    color: #3A3D58;
}

.nav-links {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 500;
}

.nav-links a {
    color: #5A5F80;
    text-decoration: none;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: #A62C3B;
}

/* ═══════════════════════════════════════════════════════════════
   Results
   ═══════════════════════════════════════════════════════════════ */
.results {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 22px;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.result-card {
    background: rgba(14, 15, 20, 0.82);
    border: 1px solid #1E1F2E;
    border-radius: 8px;
    padding: 14px;
    animation: slideIn 0.25s ease-out;
    transition: border-color 0.2s, background 0.2s;
    backdrop-filter: blur(10px);
}

.result-card.success {
    border-color: #223029;
}

.result-card.error {
    border-color: #2A1F28;
    background: rgba(14, 15, 20, 0.82);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.card-title-row,
.card-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    min-width: 0;
}

.card-filename {
    font-size: 14px;
    font-weight: 600;
    color: #AEB2CA;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.result-card.error .card-filename {
    color: #9EA2BD;
}

.card-size {
    font-size: 12px;
    font-weight: 400;
    color: #4A4F70;
    flex-shrink: 0;
}

.card-badge {
    font-size: 10px;
    font-weight: 600;
    color: #63866F;
    background: transparent;
    border: 1px solid #24352E;
    padding: 2px 5px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0;
    flex-shrink: 0;
}

/* ── URL row — selectable field style ──────────────────────── */
.card-url-row {
    display: flex;
    align-items: center;
    gap: 0;
    margin-top: 10px;
    border: 1px solid #1A1B28;
    border-radius: 6px;
    overflow: hidden;
    background: rgba(10, 10, 14, 0.72);
}

.card-url {
    font-size: 12px;
    font-family: 'Geist', monospace;
    color: #7A80A8;
    text-decoration: none;
    padding: 8px 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
    transition: color 0.2s;
    user-select: all;
}

.card-url:hover {
    color: #B0B4CC;
}

.copy-btn {
    background: rgba(20, 21, 28, 0.72);
    border: none;
    border-left: 1px solid #1E1F2E;
    width: 34px;
    min-height: 34px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}

.copy-btn:hover {
    background: #171821;
}

.copy-btn svg {
    width: 14px;
    height: 14px;
    color: #5A5F80;
}

.copy-btn.copied svg {
    color: #4AA06C;
}

/* ── Progress bar ───────────────────────────────────────────── */
.progress-container { margin-top: 10px; }

.progress-bar {
    width: 100%;
    height: 2px;
    background: #151620;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #4A4F70;
    border-radius: 2px;
    width: 0%;
    transition: width 0.15s ease;
}

.progress-text {
    font-size: 11px;
    color: #3A3D58;
    margin-top: 4px;
    text-align: right;
}

/* ── Error message ──────────────────────────────────────────── */
.card-error {
    font-size: 12px;
    color: #A62C3B;
    margin-top: 7px;
    line-height: 1.4;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════════
   Footer — pinned to bottom
   ═══════════════════════════════════════════════════════════════ */
.footer {
    padding: 20px 0;
    text-align: center;
    width: 100%;
}

.copyright {
    font-size: 14px;
    font-weight: 700;
    color: #A62C3B;
    letter-spacing: 0;
}

/* ═══════════════════════════════════════════════════════════════
   Mei standing — bottom right
   ═══════════════════════════════════════════════════════════════ */
.mei-right {
    position: fixed;
    bottom: 0;
    right: -4px;
    height: auto;
    z-index: 10;
    pointer-events: none;
    user-select: none;
    opacity: 0.8;
}

.mei-right-default {
    width: 150px;
}

.mei-right-alt {
    width: 190px;
    right: 2px;
    opacity: 0.82;
}

/* ═══════════════════════════════════════════════════════════════
   Toast
   ═══════════════════════════════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(12px);
    background: #14151C;
    border: 1px solid #1E1F2E;
    color: #9498B8;
    padding: 8px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    opacity: 0;
    pointer-events: none;
    transition: all 0.25s ease;
    z-index: 1000;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════════════
   Responsive
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 640px) {
    .page { padding: 0 16px; }
    .content { padding: 34px 0 30px; }
    .title { font-size: 26px; }
    .mei-sit { width: 60px; }
    .upload-box { padding: 40px 16px; }
    .upload-label { font-size: 16px; }
    .upload-limit { font-size: 12px; }
    .upload-icon svg { width: 32px; height: 32px; }
    .mei-right-default { width: 100px; opacity: 0.5; }
    .mei-right-alt { width: 126px; right: -12px; opacity: 0.52; }
    .card-url { font-size: 11px; }
    .card-header { align-items: flex-start; gap: 10px; }
    .card-meta { flex-shrink: 0; }
}

@media (max-width: 400px) {
    .title { font-size: 22px; }
    .mei-sit { width: 48px; }
    .upload-box { padding: 32px 12px; }
    .upload-label { font-size: 14px; }
}
