/* CSS Variablen für das nerdige Dark-Theme */
:root {
    --text-main: #e9e9e9;
    --accent-green: #00e676; 
    --accent-red: #ff3366; 
    --font-main: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background: linear-gradient(135deg, #2b1055, #7597de, #d76d77);
    background-image: 
        radial-gradient(rgba(255, 255, 255, 0.15) 2px, transparent 2px),
        radial-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
        linear-gradient(135deg, #2b1055, #7597de, #d76d77);
    background-size: 40px 40px, 20px 20px, 100% 100%;
    background-position: 0 0, 20px 20px, 0 0;
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

body.detail-page {
    padding: 20px;
}

/* --- INDEX.HTML STYLES --- */

.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: rgba(20, 20, 40, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 40px rgba(0,0,0,0.3);
}

header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header h1 {
    font-size: 1.8rem;
    color: var(--accent-green);
    text-shadow: 0 2px 10px rgba(0, 230, 118, 0.4);
}

header p {
    font-size: 0.85rem;
    color: #c9d1d9;
    margin-top: 5px;
}

.swipe-section {
    padding: 20px;
    position: relative;
    min-height: 450px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.swipe-instructions {
    display: flex;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    font-weight: bold;
}

.swipe-instructions span.red { color: var(--accent-red); }
.swipe-instructions span.green { color: var(--accent-green); }

.card-stack {
    position: relative;
    width: 100%;
    flex-grow: 1;
    transition: min-height 0.3s ease-out;
}

.tinder-card {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    min-height: 380px; /* Garantiert eine immer gleich große, bequeme Wischfläche */
    background: linear-gradient(145deg, #1e202d, #0f111c); /* Solide Farben ohne Transparenz */
    color: #e9e9e9; 
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 15px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255, 255, 255, 0.05);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: grab;
    touch-action: pan-y; /* Erlaubt vertikales Scrollen der Seite, wenn die Karte extrem groß wird */
    user-select: none;
}

/* Karten, die tief im Stapel sind, komplett ausblenden, um das Durchscheinen zu verhindern */
.tinder-card:nth-last-child(n+3) {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Die nächste Karte an die aktuelle Stapelhöhe clippen, falls sie größer als die oberste ist */
.tinder-card:nth-last-child(2) {
    max-height: 100%;
    overflow: hidden;
}

.tinder-card:active {
    cursor: grabbing;
}

.card-text {
    white-space: pre-wrap;
    width: 100%;
    padding: 0 10px;
    margin: 40px 0; /* Platz für Stats und Tags */
}

.card-stats {
    position: absolute;
    top: 15px;
    font-size: 0.85rem;
    color: #c9d1d9;
    background: rgba(0, 0, 0, 0.4);
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-tags {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 15px;
    width: 100%;
    text-align: center;
}

@keyframes swipeHandAnimation {
    0% { transform: translateX(0) rotate(0deg); }
    25% { transform: translateX(30px) rotate(15deg); }
    50% { transform: translateX(0) rotate(0deg); }
    75% { transform: translateX(-30px) rotate(-15deg); }
    100% { transform: translateX(0) rotate(0deg); }
}

.swipe-hand-icon {
    position: absolute;
    top: 60%;
    font-size: 3.5rem;
    animation: swipeHandAnimation 2s infinite ease-in-out;
    pointer-events: none; /* Klicks gehen durch das Symbol hindurch */
    z-index: 10;
    filter: drop-shadow(0 4px 10px rgba(0,0,0,0.5));
}

.hint {
    position: absolute;
    top: 50px;
    padding: 5px 10px;
    border: 2px solid;
    border-radius: 5px;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 1.5rem;
    opacity: 0;
    z-index: 10;
    pointer-events: none;
}

.hint-nope {
    right: 20px;
    color: var(--accent-red);
    border-color: var(--accent-red);
    transform: rotate(15deg);
}

.hint-witzig {
    left: 20px;
    color: var(--accent-green);
    border-color: var(--accent-green);
    transform: rotate(-15deg);
}

.list-section {
    padding: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
}

.list-section h2 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-main);
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}

.joke-list {
    list-style: none;
}

.joke-item {
    background-color: rgba(30, 32, 45, 0.95); /* Deckender statt Blur */
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    text-decoration: none;
    color: inherit;
    display: block;
    transition: transform 0.2s, border-color 0.2s;
}

.joke-item:hover {
    background-color: rgba(255, 255, 255, 0.2);
    border-color: var(--accent-green);
    transform: translateY(-2px);
}

.joke-text {
    white-space: pre-wrap;
}

.joke-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
    gap: 15px;
}

.joke-headline {
    font-weight: bold;
    color: var(--accent-green);
    font-size: 1.05rem;
    flex: 1;
    word-wrap: break-word;
}

.joke-tags-transparent {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 12px;
}

.joke-votes {
    background: rgba(0,0,0,0.2);
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 15px;
    width: 100%;
    z-index: 10;
}

.btn-action {
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-action:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.btn-lame {
    background-color: var(--accent-red);
}

.btn-lol {
    background-color: var(--accent-green);
}

.btn-share {
    background-color: #2b1055;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (min-width: 768px) {
    .mobile-only {
        display: none !important;
    }
}

.seo-section {
    padding: 20px;
    border-top: 1px dashed rgba(255, 255, 255, 0.2);
    font-size: 0.85rem;
    color: #a0aabf;
}
.seo-section summary {
    cursor: pointer;
    font-weight: bold;
    color: var(--accent-green);
    margin-bottom: 10px;
}
.seo-section ul {
    margin-left: 20px;
    margin-bottom: 10px;
    margin-top: 10px;
}

/* --- WITZ.HTML STYLES --- */

.detail-container {
    max-width: 600px;
    margin: 40px auto;
    background-color: rgba(20, 20, 40, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}

.back-link {
    display: inline-block;
    color: var(--accent-green);
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.back-link:hover {
    text-decoration: underline;
}

h1 {
    font-size: 2rem;
    color: var(--accent-green);
    line-height: 1.3;
    margin-bottom: 25px;
    text-shadow: 0 2px 10px rgba(0, 230, 118, 0.3);
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.joke-box {
    background: linear-gradient(145deg, #1e202d, #0f111c); /* Solide Farben ohne Transparenz */
    color: #e9e9e9;
    padding: 30px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 1.3rem;
    font-weight: 500;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
    white-space: pre-wrap;
}

.meta-info {
    font-size: 0.85rem;
    color: #a0aabf;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.2);
    padding-bottom: 10px;
}

.explanation-section {
    background: rgba(255, 255, 255, 0.05);
    border-left: 4px solid var(--accent-green);
    padding: 20px;
    border-radius: 0 12px 12px 0;
    margin-bottom: 30px;
}

.explanation-section h2 {
    font-size: 1.1rem;
    color: #ffffff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.explanation-section p {
    white-space: pre-wrap;
}

.votes-display {
    display: flex;
    gap: 20px;
    font-weight: bold;
    font-size: 1.1rem;
    background: rgba(0,0,0,0.3);
    padding: 12px 20px;
    border-radius: 8px;
    width: fit-content;
}

.vote-up { color: var(--accent-green); }
.vote-down { color: var(--accent-red); }

.error-msg {
    text-align: center;
    color: var(--accent-red);
    font-size: 1.2rem;
}

/* --- NEU: Styles für die Kategorie-Buttons --- */
.category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.cat-btn {
    background: rgba(255, 255, 255, 0.1);
    color: #c9d1d9;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
}

.cat-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.cat-btn.active {
    background: var(--accent-green);
    color: #0f111c;
    border-color: var(--accent-green);
    font-weight: bold;
}

/* --- SCROLL TO TOP BUTTON --- */
.scroll-to-top {
    position: fixed;
    bottom: 85px; /* Etwas Platz nach unten wegen dem Cookie Banner */
    right: 20px;
    background-color: var(--accent-green);
    color: #0f111c;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: scale(1.1);
    background-color: #00c465;
}

/* --- SCROLL TO BOTTOM BUTTON --- */
.scroll-to-bottom {
    position: fixed;
    bottom: 85px;
    left: 20px;
    background-color: rgba(255, 255, 255, 0.05); /* Sehr dezenter Hintergrund */
    color: rgba(255, 255, 255, 0.3); /* Stark abgedunkelter Pfeil */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, background-color 0.2s, color 0.2s;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scroll-to-bottom.show {
    opacity: 1;
    visibility: visible;
}

.scroll-to-bottom:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #a0aabf;
}