/* ── Reset & Basis ─────────────────────────────────────────── */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    color: #e2e8f0;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* ── Header ────────────────────────────────────────────────── */
header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: #94a3b8;
    margin-top: 0.3rem;
    font-size: 1.1rem;
}

/* ── Suchfeld ──────────────────────────────────────────────── */
.search-box {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.search-box input {
    flex: 1;
    padding: 0.9rem 1.2rem;
    border: 2px solid #334155;
    border-radius: 12px;
    background: #1e293b;
    color: #f1f5f9;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-box input:focus {
    border-color: #38bdf8;
}

.search-box button {
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #38bdf8, #818cf8);
    color: #0f172a;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    min-width: 140px;
}

.search-box button:hover:not(:disabled) {
    opacity: 0.9;
    transform: translateY(-1px);
}

.search-box button:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ── Fehler ────────────────────────────────────────────────── */
.error-box {
    background: #451a2a;
    border: 1px solid #f87171;
    color: #fca5a5;
    padding: 1rem 1.2rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* ── Ergebnis-Karten ──────────────────────────────────────── */
.result-card {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 16px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card h3 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #94a3b8;
}

/* ── Hauptergebnis ─────────────────────────────────────────── */
.cms-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.cms-name {
    font-size: 2rem;
    font-weight: 800;
    margin-top: 0.3rem;
}

.cms-name.detected {
    color: #4ade80;
}

.cms-name.unknown {
    color: #fbbf24;
}

.label {
    font-size: 0.85rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Confidence Ring ──────────────────────────────────────── */
.confidence-ring {
    position: relative;
    width: 90px;
    height: 90px;
    flex-shrink: 0;
}

.confidence-ring svg {
    transform: rotate(-90deg);
    width: 100%;
    height: 100%;
}

.confidence-ring circle {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
}

.confidence-ring .bg {
    stroke: #334155;
}

.confidence-ring .fill {
    transition: stroke-dashoffset 1s ease;
}

.conf-high { stroke: #4ade80; }
.conf-mid { stroke: #fbbf24; }
.conf-low { stroke: #f87171; }

.confidence-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.1rem;
    font-weight: 700;
    color: #e2e8f0;
}

/* ── URL Info ──────────────────────────────────────────────── */
.url-info {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #334155;
    font-size: 0.9rem;
    color: #94a3b8;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.badge {
    display: inline-block;
    background: #334155;
    color: #cbd5e1;
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-family: monospace;
}

.badge.gen {
    background: #1e3a5f;
    color: #7dd3fc;
}

/* ── Detail-Liste ──────────────────────────────────────────── */
.detail-list {
    list-style: none;
}

.detail-list li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #1e293b;
    font-size: 0.9rem;
    color: #cbd5e1;
    font-family: 'Fira Code', monospace, monospace;
}

.detail-list li::before {
    content: "✓ ";
    color: #4ade80;
}

.detail-list li:last-child {
    border-bottom: none;
}

/* ── Tags ──────────────────────────────────────────────────── */
.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: linear-gradient(135deg, #1e3a5f, #312e81);
    color: #a5b4fc;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ── Tabellen ──────────────────────────────────────────────── */
.info-table {
    width: 100%;
    border-collapse: collapse;
}

.info-table td {
    padding: 0.5rem 0.7rem;
    border-bottom: 1px solid #334155;
    font-size: 0.9rem;
    vertical-align: top;
}

.info-table .key {
    color: #38bdf8;
    font-family: monospace;
    white-space: nowrap;
    width: 1%;
    font-weight: 600;
}

.info-table tr:last-child td {
    border-bottom: none;
}

/* ── Alternativen ──────────────────────────────────────────── */
.alt-item {
    padding: 0.8rem 0;
    border-bottom: 1px solid #334155;
}

.alt-item:last-child {
    border-bottom: none;
}

.alt-item ul {
    margin-top: 0.4rem;
    margin-left: 1rem;
    font-size: 0.8rem;
    color: #94a3b8;
}

/* ── Kommentare ────────────────────────────────────────────── */
#comments-list pre {
    background: #0f172a;
    padding: 0.8rem;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #94a3b8;
    overflow-x: auto;
    margin-bottom: 0.5rem;
    border: 1px solid #334155;
}

/* ── Footer ────────────────────────────────────────────────── */
footer {
    text-align: center;
    margin-top: 2rem;
    color: #475569;
    font-size: 0.85rem;
}

/* ── Utilities ─────────────────────────────────────────────── */
.hidden {
    display: none !important;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 600px) {
    header h1 {
        font-size: 1.8rem;
    }

    .search-box {
        flex-direction: column;
    }

    .search-box button {
        min-width: unset;
    }

    .cms-header {
        flex-direction: column;
        text-align: center;
    }

    .cms-name {
        font-size: 1.6rem;
    }
}
