/**
 * Mobile Articles CSS
 * 
 * BEM-konforme Styles für die mobile Swipe-Artikel-Ansicht.
 * Nutzt bestehende CSS-Variablen für Konsistenz.
 */

/* Container für mobile Artikel-Ansicht */
.mobile-articles {
    width: 100%;
    height: calc(100vh - var(--header-height, 80px)); /* Minus Header-Höhe */
    position: relative;
    overflow: hidden;
    background-color: var(--background-color);
}

/* Container für Artikel-Stack */
.mobile-articles__container {
    position: relative;
    width: 100%;
    height: 100%;
    max-width: 100%;
    margin: 0 auto;
    touch-action: pan-y pan-x; /* Ermöglicht Swipe-Gesten */
    -webkit-overflow-scrolling: touch;
}

/* Einzelner Artikel-Card */
.mobile-articles__card {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - var(--spacing-md) * 2);
    max-width: 400px;
    height: calc(100% - var(--spacing-md) * 2);
    background-color: var(--surface-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    cursor: grab;
    transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    will-change: transform, opacity;
    z-index: 1;
    display: flex;
    flex-direction: column;
}

/* Aktiver Card (oberster im Stack) */
.mobile-articles__card:first-of-type,
.mobile-articles__card[data-active="true"] {
    z-index: 10;
    cursor: grabbing;
}

/* Cards darunter (visueller Stack-Effekt) */
.mobile-articles__card:nth-of-type(2) {
    z-index: 9;
    transform: translateX(-50%) scale(0.95) translateY(10px);
    opacity: 0.8;
}

.mobile-articles__card:nth-of-type(3) {
    z-index: 8;
    transform: translateX(-50%) scale(0.9) translateY(20px);
    opacity: 0.6;
}

/* Bild-Container */
.mobile-articles__image-container {
    position: relative;
    width: 100%;
    height: 60%;
    overflow: hidden;
    background-color: var(--background-color-medium);
}

.mobile-articles__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Swipe-Indikatoren (werden während Swipe angezeigt) */
.mobile-articles__swipe-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    padding: var(--spacing-md) var(--spacing-lg);
    background-color: var(--debug-todo);
    border: 3px solid;
    border-radius: var(--border-radius-md);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-bold);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

/* Indikator für Like (Rechts-Swipe) */
.mobile-articles__swipe-indicator--like {
    border-color: var(--success-color);
    color: var(--success-color);
}

/* Indikator für Dislike (Links-Swipe) */
.mobile-articles__swipe-indicator--dislike {
    border-color: var(--danger-color);
    color: var(--danger-color);
}

/* Indikator für Itinerary (Oben-Swipe) */
.mobile-articles__swipe-indicator--itinerary {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

/* Indikator für Skip (Unten-Swipe) */
.mobile-articles__swipe-indicator--skip {
    border-color: var(--secondary-color);
    color: var(--secondary-color);
}

/* Indikator sichtbar machen während Swipe */
.mobile-articles__card.swiping-right .mobile-articles__swipe-indicator--like,
.mobile-articles__card.swiping-left .mobile-articles__swipe-indicator--dislike,
.mobile-articles__card.swiping-up .mobile-articles__swipe-indicator--itinerary,
.mobile-articles__card.swiping-down .mobile-articles__swipe-indicator--skip {
    opacity: 0.9;
}

/* Content-Bereich */
.mobile-articles__content {
    flex: 1;
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-articles__title {
    font-size: var(--font-size-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-title);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.mobile-articles__description {
    font-size: var(--font-size-md);
    color: var(--text-body);
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
    flex: 1;
}

.mobile-articles__dates {
    margin-bottom: var(--spacing-sm);
}

.mobile-articles__date {
    font-size: var(--font-size-sm);
    color: var(--text-body-light);
    font-style: italic;
}

/* Tags */
.mobile-articles__tags {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-sm);
}

.mobile-articles__tag {
    padding: var(--spacing-xs) var(--spacing-sm);
    background-color: var(--tag-color);
    border-radius: var(--border-radius-sm);
    font-size: var(--font-size-xs);
    color: var(--text-body);
}

/* Stats (Like/Dislike Counter) */
.mobile-articles__stats {
    position: absolute;
    bottom: var(--spacing-md);
    right: var(--spacing-md);
    display: flex;
    gap: var(--spacing-md);
    background-color: var(--debug-todo);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-sm);
}

.mobile-articles__stat {
    font-size: var(--font-size-sm);
    color: var(--text-body);
}

/* Empty State */
.mobile-articles__empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: var(--text-body-light);
    font-size: var(--font-size-lg);
}

/* Lade-Indikator */
.mobile-articles__loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: var(--spacing-lg);
    background-color: var(--debug-todo);
    border-radius: var(--border-radius-md);
    box-shadow: var(--shadow-md);
    z-index: 1000;
    text-align: center;
}

/* Swipe-Animationen */
.mobile-articles__card.swiping-right {
    transform: translateX(calc(-50% + 50px)) rotate(5deg);
}

.mobile-articles__card.swiping-left {
    transform: translateX(calc(-50% - 50px)) rotate(-5deg);
}

.mobile-articles__card.swiping-up {
    transform: translateX(-50%) translateY(-50px) scale(0.95);
}

.mobile-articles__card.swiping-down {
    transform: translateX(-50%) translateY(50px) scale(0.95);
}

/* Exit-Animationen (wenn Artikel weggeswiped wird) */
.mobile-articles__card.swiped-out {
    opacity: 0;
    pointer-events: none;
}

.mobile-articles__card.swiped-out-right {
    transform: translateX(200%) rotate(30deg);
}

.mobile-articles__card.swiped-out-left {
    transform: translateX(-200%) rotate(-30deg);
}

.mobile-articles__card.swiped-out-up {
    transform: translateX(-50%) translateY(-200%) scale(0.8);
}

.mobile-articles__card.swiped-out-down {
    transform: translateX(-50%) translateY(200%) scale(0.8);
}

/* Responsive Anpassungen */
@media (max-width: 480px) {
    .mobile-articles {
        height: calc(100vh - var(--header-height, 60px));
    }
    
    .mobile-articles__card {
        width: calc(100% - var(--spacing-sm) * 2);
        height: calc(100% - var(--spacing-sm) * 2);
    }
    
    .mobile-articles__title {
        font-size: var(--font-size-lg);
    }
    
    .mobile-articles__description {
        font-size: var(--font-size-sm);
    }
}

/* Dark Mode Anpassungen */
[data-theme="dark"] .mobile-articles__swipe-indicator {
    background-color: var(--debug-todo);
    color: var(--text-body-white);
}

[data-theme="dark"] .mobile-articles__stats {
    background-color: var(--debug-todo);
    color: var(--text-body-white);
}

[data-theme="dark"] .mobile-articles__loading {
    background-color: var(--debug-todo);
    color: var(--text-body-white);
}


footer {
    display: none;
}