/* ============================================================
   FootSim Tools - PDF Merge
   ------------------------------------------------------------
   Eigenstaendiges Stylesheet. Uebernimmt die Design Tokens aus
   static/style.css, aber als CSS Variablen sauber gebuendelt,
   damit spaetere Tools sie wiederverwenden koennen.
   ============================================================ */

:root {
    /* Flaechen */
    --bg-base:      #050505;
    --bg-panel:     #0d0d0d;
    --bg-card:      #141414;
    --bg-inner:     #151515;

    /* Rahmen */
    --border-panel: #222222;
    --border-card:  #2a2a2a;
    --border-inner: #242424;
    --border-soft:  #262626;

    /* Text */
    --text:         #ffffff;
    --text-muted:   #b7b7b7;
    --text-dim:     #a0a0a0;
    --text-faint:   #8d8d8d;

    /* Akzente */
    --accent:       #f2f2f2;
    --accent-blue:  #2563eb;
    --danger:       #ef4444;

    /* Radien */
    --r-panel:      28px;
    --r-card:       20px;
    --r-inner:      22px;
    --r-btn:        18px;
    --r-input:      14px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: var(--bg-base);
    color: var(--text);
}

.app {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

.hidden {
    display: none !important;
}

/* ===================== HERO ===================== */
/* Hell gehalten, exakt wie auf der FootSim Startseite */

.hero {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 20px;
    background-color: #f8fafc;
    border-radius: var(--r-panel);
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.hero-content {
    max-width: 600px;
}

.hero .eyebrow {
    display: inline-block;
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 12px;
}

.hero h1 {
    font-size: 42px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px 0;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero .subtitle {
    font-size: 18px;
    color: #475569;
    line-height: 1.6;
    margin: 0 0 32px 0;
}

.support {
    margin-top: 16px;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: #0f172a;
    color: #ffffff;
    border-radius: 999px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.25);
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: #1e293b;
    box-shadow: 0 6px 20px rgba(15, 23, 42, 0.4);
    transform: translateY(-2px);
}

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

.back-icon {
    width: 18px;
    height: 18px;
}

/* ===================== LAYOUT ===================== */

.grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 20px;
    margin-top: 20px;
}

.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-panel);
    border-radius: var(--r-panel);
    padding: 24px;
}

.section-head h2 {
    margin: 8px 0 0 0;
}

.section-head-spaced {
    margin-top: 22px;
}

/* Eyebrow innerhalb der dunklen Panels bleibt grau */
.panel .eyebrow {
    margin: 0;
    color: var(--text-faint);
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-size: 0.78rem;
    font-weight: normal;
}

/* ===================== DROPZONE ===================== */

.dropzone {
    margin-top: 18px;
    padding: 28px 18px;
    border: 1px dashed var(--border-card);
    border-radius: var(--r-card);
    background: var(--bg-card);
    text-align: center;
    cursor: pointer;
    transition: 0.2s ease;
}

.dropzone:hover {
    border-color: #4b4b4b;
    transform: translateY(-1px);
}

.dropzone.dragover {
    border-color: var(--accent);
    border-style: solid;
    background: #1c1c1c;
}

.dropzone-icon svg {
    width: 34px;
    height: 34px;
    color: var(--text-faint);
}

.dropzone.dragover .dropzone-icon svg {
    color: var(--accent);
}

.dropzone-title {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: bold;
}

.dropzone-sub {
    margin-top: 4px;
    color: var(--text-dim);
    font-size: 0.88rem;
}

.dropzone-formats {
    margin-top: 12px;
    color: var(--text-faint);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

/* ===================== BUTTONS ===================== */

.merge-btn,
.secondary-btn,
.danger-btn {
    width: 100%;
    border-radius: var(--r-btn);
    padding: 16px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s ease;
}

.merge-btn {
    margin-top: 18px;
    border: none;
    background: var(--accent);
    color: #000000;
}

.merge-btn:hover:not(:disabled) {
    background: #ffffff;
}

.merge-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.secondary-btn {
    margin-top: 12px;
    border: 1px solid var(--border-card);
    background: var(--bg-card);
    color: var(--text);
}

.secondary-btn:hover {
    border-color: #4b4b4b;
    transform: translateY(-1px);
}

.danger-btn {
    margin-top: 12px;
    border: 1px solid #3a2020;
    background: #1a1010;
    color: #e06a6a;
}

.danger-btn:hover {
    border-color: var(--danger);
    color: #ff8080;
}

/* ===================== FORM CONTROLS ===================== */

.controls {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.controls label {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.controls input[type="text"] {
    background: var(--bg-card);
    color: var(--text);
    border: 1px solid var(--border-card);
    border-radius: var(--r-input);
    padding: 12px;
    font-family: inherit;
    font-size: 0.95rem;
}

.controls input[type="text"]:focus {
    outline: none;
    border-color: #4b4b4b;
}

.checkbox-row {
    flex-direction: row;
    align-items: center;
    gap: 10px;
}

.status {
    margin-top: 16px;
    color: var(--text-dim);
    font-size: 0.95rem;
}

/* ===================== EMPTY STATES ===================== */

.left-empty-state,
.empty-state {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #9d9d9d;
    text-align: center;
    border: 1px dashed var(--border-card);
    border-radius: var(--r-card);
    margin-top: 18px;
    padding: 18px;
}

.left-empty-state h3,
.empty-state h2 {
    margin-bottom: 8px;
}

.left-empty-state p,
.empty-state p {
    margin: 0;
}

/* ===================== RECHTE SPALTE: HEADER ===================== */

.result-header {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    align-items: flex-start;
}

.result-header h2 {
    margin: 8px 0 0 0;
    font-size: 2rem;
}

.summary-box {
    background: var(--bg-inner);
    border: 1px solid var(--border-card);
    border-radius: var(--r-card);
    padding: 14px 16px;
    text-align: right;
    flex-shrink: 0;
}

.summary-box span,
.summary-box small {
    display: block;
    color: var(--text-dim);
}

.summary-box strong {
    display: block;
    margin: 6px 0;
    font-size: 1.1rem;
}

.hint-line {
    margin: 18px 0 0 0;
    color: var(--text-faint);
    font-size: 0.88rem;
}

/* ===================== DATEILISTE ===================== */

.file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 18px;
}

.file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border-card);
    border-radius: var(--r-card);
    transition: 0.2s ease;
    cursor: grab;
}

.file-card:hover {
    border-color: #4b4b4b;
}

.file-card.dragging {
    opacity: 0.4;
    cursor: grabbing;
}

.file-card.drop-target {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.rank-badge {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #222222;
    border-radius: 999px;
    color: #d8d8d8;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.file-thumb {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    object-fit: cover;
    background: #ffffff;
    flex-shrink: 0;
}

.file-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-inner);
    border: 1px solid var(--border-inner);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: bold;
    letter-spacing: 0.04em;
    color: var(--text-dim);
    flex-shrink: 0;
}

.file-meta {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.3;
    word-break: break-word;
}

.file-sub {
    color: var(--text-dim);
    font-size: 0.82rem;
    margin-top: 4px;
}

.file-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.icon-btn {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    color: var(--text-dim);
    font-size: 0.72rem;
    cursor: pointer;
    transition: 0.15s ease;
}

.icon-btn:hover:not(:disabled) {
    background: #222222;
    color: var(--text);
    border-color: #4b4b4b;
}

.icon-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.icon-btn.remove:hover {
    border-color: var(--danger);
    color: #ff8080;
}

/* ===================== ERGEBNIS ===================== */

.result-box {
    min-height: 320px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background: var(--bg-inner);
    border: 1px solid var(--border-inner);
    border-radius: var(--r-inner);
    padding: 32px 24px;
}

.result-icon {
    width: 62px;
    height: 62px;
    border-radius: 999px;
    background: #16281a;
    border: 1px solid #244a2b;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

.result-icon svg {
    width: 30px;
    height: 30px;
    color: #4ade80;
}

.result-box h2 {
    margin: 0 0 8px 0;
}

.result-box p {
    margin: 0 0 22px 0;
    color: var(--text-dim);
}

.download-btn {
    display: inline-block;
    background: var(--accent);
    color: #000000;
    border-radius: var(--r-btn);
    padding: 16px 32px;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s ease;
}

.download-btn:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.result-box .secondary-btn {
    width: auto;
    padding: 12px 24px;
    font-size: 0.92rem;
    margin-top: 16px;
}

/* ===================== LADEBALKEN ===================== */

.progress-track {
    margin-top: 18px;
    height: 12px;
    background: #222222;
    border-radius: 999px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    border-radius: 999px;
    transition: width 0.25s ease;
}

/* ===================== RESPONSIVE ===================== */

@media (max-width: 900px) {
    .grid {
        grid-template-columns: 1fr;
    }

    .result-header {
        flex-direction: column;
    }

    .summary-box {
        width: 100%;
        text-align: left;
    }

    .hero h1 {
        font-size: 30px;
    }
}

@media (max-width: 768px) {
    .app {
        padding: 16px;
    }

    .hero,
    .panel {
        padding: 18px;
        border-radius: var(--r-card);
    }

    .hero {
        padding: 40px 18px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero .subtitle {
        font-size: 0.95rem;
    }

    .result-header h2 {
        font-size: 1.5rem;
    }

    .file-card {
        padding: 12px;
        gap: 10px;
    }

    .file-thumb,
    .file-icon {
        width: 36px;
        height: 36px;
    }

    .rank-badge {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .merge-btn,
    .secondary-btn,
    .danger-btn {
        padding: 14px;
        font-size: 0.95rem;
    }
}
