/* ============================================================
 * MatLuk FotoChallenge — Quest-Favoriten (Iter V.6)
 *
 * - Stern-Toggle in Quest-Detail-Hero
 * - Favoriten-Cards in Quest-Uebersicht (gleicher Stil wie Daily/Duell)
 * ============================================================ */

/* === Stern-Toggle in Quest-Detail-Hero === */
.qd-fav-form {
    margin: 0;
    flex-shrink: 0;
    align-self: flex-start;
}

.qd-fav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--text-dim, #9ca3af);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    -webkit-tap-highlight-color: transparent;
    padding: 0;
}

.qd-fav-btn:hover:not(:disabled) {
    border-color: #fbbf24;
    color: #fbbf24;
    transform: scale(1.06);
}

.qd-fav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.qd-fav-btn.is-favorited {
    background: rgba(251, 191, 36, 0.18);
    border-color: #fbbf24;
    color: #fbbf24;
}

.qd-fav-btn.is-favorited:hover {
    background: rgba(251, 191, 36, 0.28);
}

.qd-fav-btn.is-favorited svg {
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.4));
}

/* Hero-Layout: Stern-Button rechts ausrichten */
.ig-quest-detail-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.ig-quest-detail-info {
    flex: 1;
    min-width: 0;
}

[data-theme="light"] .qd-fav-btn {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.10);
    color: #6b7280;
}

[data-theme="light"] .qd-fav-btn.is-favorited {
    background: rgba(251, 191, 36, 0.20);
    color: #b45309;
}


/* === Iter V.6: Time-Hint auf Quest-Detail (Daily/Event) === */
.qd-time-hint {
    display: flex;
    gap: 12px;
    padding: 12px 14px;
    margin: 14px 0 18px;
    background: rgba(99, 102, 241, 0.07);
    border: 1px solid rgba(99, 102, 241, 0.22);
    border-radius: 12px;
    align-items: flex-start;
}

.qd-time-hint-icon {
    font-size: 22px;
    line-height: 1;
    flex-shrink: 0;
}

.qd-time-hint-text {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text, #fff);
}

.qd-time-hint-text strong {
    color: #818cf8;
}

[data-theme="light"] .qd-time-hint {
    background: rgba(99, 102, 241, 0.10);
    border-color: rgba(99, 102, 241, 0.30);
}
[data-theme="light"] .qd-time-hint-text strong {
    color: #4f46e5;
}


/* === Favoriten-Cards in Quest-Uebersicht === */
.qx-card-favorite {
    /* Subtle goldener Tint zum Daily/Duell-Stil */
    border-color: rgba(251, 191, 36, 0.25) !important;
}

.qx-card-favorite:hover {
    border-color: rgba(251, 191, 36, 0.45) !important;
    box-shadow: 0 4px 14px rgba(251, 191, 36, 0.12);
}

.qx-card-img-favorite {
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 0.06),
        rgba(245, 158, 11, 0.04));
}

/* Stern-Badge oben rechts an der Card */
.qx-card-overlay-badge.fav-badge {
    background: rgba(251, 191, 36, 0.92) !important;
    color: #422006 !important;
    font-size: 14px !important;
    width: 26px;
    height: 26px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50% !important;
    box-shadow: 0 2px 6px rgba(251, 191, 36, 0.4);
}

/* Light-Mode */
[data-theme="light"] .qx-card-img-favorite {
    background: linear-gradient(135deg,
        rgba(251, 191, 36, 0.10),
        rgba(245, 158, 11, 0.06));
}

/* === Iter V.6: Sektionen auf der Quest-Übersicht === */
.qx-section {
    margin-bottom: 22px;
}

.qx-section:not(:first-child) {
    /* Dezente Trennlinie zwischen Sektionen */
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .qx-section:not(:first-child) {
    border-top-color: rgba(0, 0, 0, 0.07);
}

.qx-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    padding: 0 4px;
}

.qx-section-title {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
    color: var(--text, #fff);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}

.qx-section-sub {
    font-size: 12px;
    color: var(--text-dim, #9ca3af);
    font-weight: 500;
    white-space: nowrap;
}

/* === Favoriten-Empty-State === */
.qx-favorites-empty {
    text-align: center;
    padding: 24px 18px;
    background: rgba(251, 191, 36, 0.04);
    border: 1px dashed rgba(251, 191, 36, 0.25);
    border-radius: 12px;
}

.qx-favorites-empty-icon {
    font-size: 38px;
    line-height: 1;
    opacity: 0.7;
    margin-bottom: 8px;
}

.qx-favorites-empty-text {
    margin: 0 0 6px;
    font-size: 14px;
    color: var(--text, #fff);
}

.qx-favorites-empty-hint {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
    color: var(--text-dim, #9ca3af);
    max-width: 380px;
    margin-left: auto;
    margin-right: auto;
}

[data-theme="light"] .qx-favorites-empty {
    background: rgba(251, 191, 36, 0.07);
    border-color: rgba(251, 191, 36, 0.35);
}


/* === Iter V.6: Favoriten im Bottom-Sheet (Foto-CTA-Modal) ===
   Kompakte Mini-Cards in Auto-Grid, direkt klickbar. */
.cta-favorites-section {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.cta-favorites-title {
    font-size: 14px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text, #fff);
    display: flex;
    align-items: center;
    gap: 6px;
}

.cta-favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    /* Bei vielen Favoriten begrenzt scrollen, damit Modal nicht endlos wird */
    max-height: 50vh;
    max-height: 50dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 2px;
}

.cta-fav-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: rgba(251, 191, 36, 0.06);
    border: 1px solid rgba(251, 191, 36, 0.18);
    border-radius: 10px;
    text-decoration: none;
    color: var(--text, #fff);
    transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
    -webkit-tap-highlight-color: transparent;
}

.cta-fav-card:hover {
    border-color: rgba(251, 191, 36, 0.45);
    background: rgba(251, 191, 36, 0.10);
    transform: translateY(-1px);
}

.cta-fav-card:active {
    transform: scale(0.98);
}

.cta-fav-card-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.cta-fav-card-img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cta-fav-card-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.cta-fav-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.cta-fav-card-title {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.cta-fav-card-meta {
    font-size: 11px;
    color: var(--text-dim, #9ca3af);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.cta-fav-card-meta .diff {
    font-size: 10px;
    padding: 1px 5px;
}

/* Light-Mode */
[data-theme="light"] .cta-favorites-section {
    border-top-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .cta-fav-card {
    background: rgba(251, 191, 36, 0.10);
    border-color: rgba(251, 191, 36, 0.30);
    color: #1f2937;
}

[data-theme="light"] .cta-fav-card:hover {
    background: rgba(251, 191, 36, 0.18);
}

[data-theme="light"] .cta-fav-card-img {
    background: rgba(0, 0, 0, 0.03);
}
