/* Farbvariablen & Design-Tokens */
:root {
    --bg-dark: #070a12;
    --card-bg: rgba(15, 23, 42, 0.65);
    --card-border: rgba(65, 126, 237, 0.25);
    --card-border-hover: rgba(65, 126, 237, 0.7);
    --primary-blue: #417eed;
    --accent-blue: #60a5fa;
    --glow-blue: rgba(65, 126, 237, 0.35);
    --text-white: #f8fafc;
    --text-dim: #94a3b8;
    --radius: 20px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 1.05rem;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
    padding: 2rem 1rem;
}

/* Background Glow */
.bg-glow {
    position: fixed;
    top: -10%;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--glow-blue) 0%, rgba(7, 10, 18, 0) 70%);
    z-index: -1;
    pointer-events: none;
    filter: blur(50px);
}

.container {
    width: 100%;
    max-width: 75%;
    margin: 0 auto;
}

/* Zurück-Button */
.back-nav {
    margin-bottom: 2rem;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--accent-blue);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 1.2rem;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 50px;
    backdrop-filter: blur(10px);
    transition: all 0.25s ease;
}

.back-btn:hover {
    color: var(--text-white);
    border-color: var(--primary-blue);
    background: rgba(65, 126, 237, 0.2);
    box-shadow: 0 0 15px var(--glow-blue);
    transform: translateX(-3px);
}

/* Card Container */
.page-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 2.5rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 10px 30px -10px var(--glow-blue);
    margin-bottom: 2rem;
}

.card-icon {
    font-size: 1.5rem;
    color: var(--accent-blue);
    margin-bottom: 1rem;
}

h1 {
    color: var(--text-white);
    font-size: 2.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, #ffffff 30%, var(--accent-blue) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
}

.subtitle {
    color: var(--text-dim);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.divider {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 1.75rem 0;
}

/* ===== Badge-Galerie: Aktenordner-Stapel ===== */
.badge-grid {
    --badge-w: 150px;   /* Breite laut Credly-Embed */
    --badge-h: 270px;   /* Höhe laut Credly-Embed */
    --overlap: 36px;    /* Wie weit sich die Badges überlappen */
    --lift: 14px;       /* Wie weit der Badge beim Hover nach links wandert */

    display: flex;
    flex-wrap: wrap;            /* Zu viele Badges -> neue Reihe */
    justify-content: center;    /* Jede Reihe mittig */
    align-items: flex-start;
    column-gap: 0;
    row-gap: 2rem;
    padding: 1rem 0;
}

/* Jeder Badge: weißer Hintergrund, leichter Stroke, überlappt den Vorgänger */
.badge-grid > [data-share-badge-id],
.badge-grid > iframe {
    position: relative;
    flex: 0 0 auto;
    width: var(--badge-w);
    height: var(--badge-h);
    margin-inline: calc(var(--overlap) / -2);   /* negativer Rand = Überlappung, bleibt mittig */
    background: #ffffff;
    border: none;
    border-radius: 12px;
    line-height: 0;
    box-shadow:
            0 0 0 1.5px rgba(96, 165, 250, 0.45),    /* Stroke */
            -8px 0 16px -6px rgba(0, 0, 0, 0.55);     /* Schatten auf den linken Nachbarn */
    transition:
            transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
            box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Das von Credly eingefügte iframe füllt das div aus */
.badge-grid [data-share-badge-id] iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
    background: #ffffff;
}

.badge-grid > [data-share-badge-id]:hover,
.badge-grid > iframe:hover {
    transform: translateX(-35%) scale(1.1);
    box-shadow:
            0 0 0 1.5px var(--accent-blue),
            -10px 12px 28px -6px rgba(0, 0, 0, 0.65),
            0 0 24px var(--glow-blue);
}

/* Unsichtbare Hover-Zone rechts, damit der Badge beim Verschieben nicht flackert */
.badge-grid > [data-share-badge-id]::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: calc(var(--lift) * -1);
    width: var(--lift);
}

/* Footer */
footer {
    text-align: center;
    padding-top: 1.5rem;
}

footer a {
    color: var(--text-dim);
    text-decoration: none;
    font-size: 0.9rem;
}

footer a:hover {
    color: var(--accent-blue);
}

footer p {
    color: rgba(255, 255, 255, 0.3);
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Kleine Bildschirme: Karte nutzt die volle Breite */
@media (max-width: 600px) {
    .container {
        max-width: 100%;
    }

    .page-card {
        padding: 1.5rem;
    }

    h1 {
        font-size: 1.8rem;
    }
}

/* Handy & Tablet: kein Stapel, alle Badges sind komplett sichtbar und normal aufgereiht */
@media (max-width: 1024px), (hover: none) {
    .container {
        max-width: 100%;
    }
    .badge-grid {
        --overlap: 0px;
        --lift: 0px;
        column-gap: 1.5rem;
        row-gap: 1.5rem;
    }

    .badge-grid > [data-share-badge-id],
    .badge-grid > iframe {
        box-shadow: none;
        transition: none;
    }

    .badge-grid > [data-share-badge-id]:hover,
    .badge-grid > iframe:hover {
        z-index: auto;
        transform: none;
        box-shadow: none;
    }

    .badge-grid > [data-share-badge-id]::after {
        display: none;
    }
}