/* Füge eine Flip-Animation hinzu */
@keyframes flipIn {
    0% {
        transform: rotateY(180deg);
        opacity: 0;
    }

    50% {
        transform: rotateY(90deg);
        opacity: 1;
    }

    100% {
        transform: rotateY(0deg);
        opacity: 1;
    }
}

/* Container für die project-Kacheln */
.project-tiles {
    display: flex;
    justify-content: center;
    gap: 40px;
    padding: 40px;
    flex-wrap: wrap;
}

/* Zentrierter Container für die Tabs */
.tabs-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    position: relative;
}

/* Tabs als Registerkarten */
.tabs {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
    align-items: center;
}

/* Tab Button */
.tab-button {
    background: linear-gradient(135deg,
            #09cc94 0%,
            #09cc94 50%,
            #0fbf8c 50%,
            #0fbf8c 75%,
            #007e68 75%,
            #007e68 100%);
    border: 2px solid transparent;
    color: #fff;
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 1;
    margin-top: 10px;
}

/* Gedimmte Tabs (inaktive Tabs) */
.tab-button.inactive {
    opacity: 0.4;
    border-color: rgba(255, 255, 255, 0.3);
}

/* Der aktive Tab */
.tab-button.active {
    background: linear-gradient(135deg,
            #007e68 0%,
            #007e68 50%,
            #09cc94 50%,
            #09cc94 75%,
            #0fbf8c 75%,
            #0fbf8c 100%);
    color: white;
    border-color: #09cc94;
    box-shadow: 0 0 15px 5px rgba(9, 204, 148, 0.7);
    z-index: 2;
}

/* Tab-Inhalte */
.tab-content {
    display: none;
    margin-top: 20px;
}

/* Aktiver Tab-Inhalt */
.tab-content.active {
    display: block;
}

/* Basisstil für die project-Kacheln */
.tile.project-tile {
    width: 300px;
    height: 300px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    transition: transform 0.5s, box-shadow 0.5s, background 0.5s;
    font-family: 'Open Sans', sans-serif;
    font-size: 1em;
    color: #000;
    text-decoration: none;
    position: relative;
    z-index: 1;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg,
            #09cc94 0%,
            #09cc94 50%,
            #0fbf8c 50%,
            #0fbf8c 75%,
            #007e68 75%,
            #007e68 100%);
    transform-style: preserve-3d;
    animation: flipIn 1s ease-out;
    animation-iteration-count: 1;
    overflow: visible;
}

/* Vorderseite der Kachel */
.tile-front {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: opacity 0.3s ease-in-out;
    text-align: center;
    padding-left: 10px;
    padding-right: 10px;
    padding-top: 10px;
}

.tile-front i {
    font-size: 3em;
    margin-bottom: 15px;
    color: #000;
}

.tile-front,
.tile-back {
    border-radius: 10px;
}

/* Rückseite der Kachel */
.tile-back {
    position: absolute;
    font-size: 0.85em;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    padding: 15px 5px 5px 30px;
    text-align: left;
}

.tile-back ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.tile-back li {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.85em;
}

.tile-back .dot {
    width: 6px;
    height: 6px;
    background-color: #09cc94;
    border-radius: 50%;
    margin-right: 8px;
}

/* Hover-Effekt: Nur beim Hovern wird die Rückseite sichtbar */
.tile.project-tile:hover .tile-front {
    opacity: 0;
    display: none;
}

.tile.project-tile:hover .tile-back {
    opacity: 1;
}

/* Tag für AL / CAL (oben rechts) */
.tile.project-tile::before {
    content: attr(data-tag-lang);
    position: absolute;
    top: 2px;
    right: 5px;
    background: #d32f2f;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 20px;
    transform-origin: center;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    width: fit-content;
}

/* Tag für Cloud / SaaS (oben links) */
.tile.project-tile::after {
    content: attr(data-tag-type);
    position: absolute;
    top: 2px;
    left: 5px;
    background: #1976d2;
    color: white;
    font-size: 12px;
    font-weight: bold;
    padding: 5px 20px;
    transform-origin: center;
    z-index: 2;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    width: fit-content;
}

.tile-front p {
    margin: 0.1em 0;
    text-align: center;
}

/* Zusätzlicher Abstand vor dem Zeitraum */
.tile-front .large-gap {
    margin-top: 2em;
}

/* Optional: Icons etwas Abstand vom Text geben */
.tile-front i {
    margin-right: 0.5em;
    font-size: 1em;
}

/* --- Neue Regeln für Detailmodus --- */
body.details-mode .tile.project-tile .tile-front {
    opacity: 0 !important;
    display: none !important;
}

body.details-mode .tile.project-tile .tile-back {
    opacity: 1 !important;
}

/* Deaktiviert Übergänge beim Hover, wenn Detailmodus aktiv ist */
body.details-mode .tile.project-tile:hover .tile-front,
body.details-mode .tile.project-tile:hover .tile-back {
    transition: none !important;
}

/* --- Styles für den modernen Toggle-Switch --- */
.switch-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: 20px;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 32px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #bbb;
    transition: 0.4s;
    border-radius: 32px;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.3);
}

.slider:before {
    position: absolute;
    content: "";
    height: 24px;
    width: 24px;
    left: 4px;
    bottom: 4px;
    background: #fff;
    transition: 0.4s;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.switch input:checked+.slider {
    background: linear-gradient(135deg,
            #007e68 0%,
            #007e68 50%,
            #09cc94 50%,
            #09cc94 75%,
            #0fbf8c 75%,
            #0fbf8c 100%);
}

.switch input:checked+.slider:before {
    transform: translateX(28px);
}

.switch-label {
    font-size: 1.1em;
    font-weight: 600;
    color: #fff
}

/* --- Neue Regeln für die Archiv-Timeline (überarbeitete Version) --- */
.archive-timeline {
    position: relative;
    padding-left: 100px;
    /* Platz für die Timeline und Year-Labels */
    overflow-y: auto;
    scroll-behavior: smooth;
    animation: fadeInUp 0.8s ease-out;
}

/* Vertikale Linie */
.archive-timeline::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50px;
    /* zentrale Linie */
    width: 3px;
    background: #09cc94;
}

/* Jede Jahresgruppe als Flex-Container */
.archive-year-group {
    position: relative;
    margin-bottom: 40px;
    display: flex;
    align-items: flex-start;
}

/* Jahr-Label als moderner Badge – mit feiner, moderner Schrift */
.archive-year-group .year-title {
    position: absolute;
    left: -80px;
    /* Badge näher an der Linie */
    top: 0;
    font-size: 18px;
    font-weight: 300;
    /* dünnere Schrift */
    letter-spacing: 1px;
    /* etwas mehr Abstand zwischen den Buchstaben */
    font-family: 'Open Sans', sans-serif;
    color: #000;
    text-transform: uppercase;
    background-color: #09cc94;
    padding: 6px 12px;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Die Projekte innerhalb einer Gruppe – Abstand zur Timeline */
.archive-project-tiles {
    margin-left: 70px;
    display: flex;
    flex-wrap: wrap;
    gap: 40px;
}


/* --- Button zentral in der Kachel platzieren & immer sichtbar --- */
.project-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    /* Sorgt für eine gleichmäßige Verteilung */
    padding-bottom: 50px;
    /* Platz für den Button */
    position: relative;
}

/* --- Button-Farbe an Kachel-Hintergrund anpassen --- */
.project-button {
    position: absolute;
    bottom: 10px;
    /* Abstand zum unteren Rand der Kachel */
    left: 50%;
    transform: translateX(-50%);
    /* Perfekt zentrieren */
    width: 80%;
    text-align: center;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    font-family: 'Roboto', sans-serif;
    color: white;
    background: rgba(0, 0, 0, 0.5);
    /* Transparente dunkle Hintergrundfarbe */
    border-radius: 6px;
    text-decoration: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    /* Dezente weiße Umrandung */
}

/* Button-Farbe innerhalb der Kachel */
.project-tile:hover .project-button {
    background: rgba(255, 255, 255, 0.3);
    /* Etwas heller beim Hover über die Kachel */
    border: 1px solid rgba(255, 255, 255, 0.5);
}

/* Keyframes für Fade-In + Slide-Up Effekt */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Responsive Anpassungen */
@media (max-width: 768px) {
    .project-tiles {
        gap: 20px;
        padding: 20px;
        flex-direction: column;
        /* Stellt sicher, dass die Kacheln untereinander angezeigt werden */
        align-items: center;
        /* Zentriert die Kacheln */
    }

    .tile.project-tile {
        width: 300px;
        /* Doppelte Breite */
        height: 300px;
        /* Doppelte Höhe */
    }

    .tabs-container {
        padding: 5px;
    }

    .tab-button {
        font-size: 0.7em;
        padding: 6px 12px;
    }

    #archive .project-tile {
        width: 250px;
        /* Doppelte Breite */
        height: 250px;
        /* Doppelte Höhe */
    }

    #archive .archive-project-tiles {
        gap: 10px;
        /* Noch enger auf Handys */
        margin-left: 30px;
    }

    #archive .tile-front p,
    #archive .tile-back ul li {
        font-size: 0.8em;
        /* Schrift um 15% reduziert */
    }

    #archive .archive-timeline {
        padding-left: 50px;
        /* Noch weniger Platz für die Timeline */
    }

    #archive .archive-timeline::before {
        left: 20px;
        /* Noch weiter nach links */
        width: 2px;
        /* Dünnere Linie */
    }

    #archive .year-title {
        font-size: 14px;
        /* Noch kleinere Jahreszahl */
        left: -50px;
        /* Perfekt zur Linie ausgerichtet */
        padding: 3px 8px;
    }

    #archive .tile.project-tile::before {
        content: attr(data-tag-lang);
        font-size: 8px;
    }

    #archive .tile.project-tile::after {
        content: attr(data-tag-type);
        font-size: 8px;
    }

    .switch input:checked+.slider:before {
        transform: translateX(10px);
    }
}

@media (max-width: 480px) {
    .project-tiles {
        gap: 20px;
        padding: 20px;
        flex-direction: column;
        /* Stellt sicher, dass die Kacheln untereinander angezeigt werden */
        align-items: center;
        /* Zentriert die Kacheln */
    }

    .tile.project-tile {
        width: 300px;
        /* Doppelte Breite */
        height: 300px;
        /* Doppelte Höhe */
    }

    .tabs-container {
        padding: 5px;
    }

    .tab-button {
        font-size: 0.7em;
        padding: 6px 12px;
    }

    #archive .project-tile {
        width: 275px;
        /* Doppelte Breite */
        height: 275px;
        /* Doppelte Höhe */
    }

    #archive .archive-project-tiles {
        gap: 10px;
        /* Noch enger auf Handys */
        margin-left: 10px;
    }

    #archive .tile-front p,
    #archive .tile-back ul li {
        font-size: 0.8em;
        /* Schrift um 15% reduziert */
    }

    #archive .archive-timeline {
        padding-left: 50px;
        /* Noch weniger Platz für die Timeline */
    }

    #archive .archive-timeline::before {
        left: 20px;
        /* Noch weiter nach links */
        width: 2px;
        /* Dünnere Linie */
    }

    #archive .year-title {
        font-size: 14px;
        /* Noch kleinere Jahreszahl */
        left: -50px;
        /* Perfekt zur Linie ausgerichtet */
        padding: 3px 8px;
    }

    #archive .tile.project-tile::before {
        content: attr(data-tag-lang);
        font-size: 8px;
    }

    #archive .tile.project-tile::after {
        content: attr(data-tag-type);
        font-size: 8px;
    }
}