/* ===== CARDS ===== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

/* Feature Cards */
.feature-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: all var(--transition-normal);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    background: linear-gradient(135deg, var(--turquoise-light), var(--violet-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.feature-icon img {
    width: var(--icon-xl);
    height: var(--icon-xl);
    filter: drop-shadow(2px 2px 4px rgba(62, 73, 118, 0.3));
}

.feature-card h3 {
    font-size: 1.3rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.feature-card p {
    color: var(--gray-medium);
    line-height: 1.6;
}

/* Quest Cards */
.quest-card {
    background: var(--white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal), opacity 0.3s ease, transform 0.3s ease;
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
    display: flex;              /* Align internal blocks vertically */
    flex-direction: column;     /* Title/desc above, stats at bottom */
    min-height: 460px;          /* Equalize heights so stats align with longer text */
}

.quest-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--turquoise-medium), var(--violet-medium));
}

.quest-card.sport::before {
    background: linear-gradient(90deg, var(--orange), var(--yellow));
}

.quest-card.culture::before {
    background: linear-gradient(90deg, var(--violet-medium), var(--violet-dark));
}

.quest-card.wellness::before {
    background: linear-gradient(90deg, var(--turquoise-medium), var(--turquoise-dark));
}

.quest-card.social::before {
    background: linear-gradient(90deg, var(--turquoise-light), var(--violet-light));
}

.quest-card.action::before {
    background: linear-gradient(90deg, var(--orange), var(--violet-medium));
}

.quest-card.event::before {
    background: linear-gradient(90deg, var(--orange), var(--violet-dark));
}

.quest-card.exploration::before {
    background: linear-gradient(90deg, var(--turquoise-medium), var(--turquoise-dark));
}

.quest-card.business::before {
    background: linear-gradient(90deg, var(--violet-dark), var(--orange));
}

/* New category: énigme / réflexion */
.quest-card.enigme::before {
    background: linear-gradient(90deg, var(--violet-medium), var(--turquoise-medium));
}

.quest-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.quest-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.quest-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(1px 1px 2px rgba(62, 73, 118, 0.2));
}

.quest-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--spacing-xs);
    min-height: 44px; /* mode + auteur alignés visuellement */
}

.quest-mode {
    background: rgba(68, 190, 170, 0.2);
    color: var(--turquoise-dark);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quest-creator {
    color: var(--gray-medium);
    font-size: 0.8rem;
    font-style: italic;
    font-weight: 500;
}

.quest-category {
    background: rgba(178, 177, 217, 0.2);
    color: var(--violet-dark);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quest-card h3,
.quest-card h4 {
    font-size: 1.3rem;
    color: var(--violet-dark);
    margin-bottom: var(--spacing-sm);
    font-weight: 700;
}

.quest-card p {
    color: var(--gray-medium);
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
    display: -webkit-box;             /* clamp description for consistent height */
    -webkit-line-clamp: 6;            /* ~6 lines on desktop */
    -webkit-box-orient: vertical;
    line-clamp: 6;                    /* standard property for compatibility */
    overflow: hidden;
}

/* Utility: remove clamp when needed for longer descriptions */
.quest-card p.no-clamp {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    overflow: visible;
}

.quest-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;           /* Push stats to the bottom of the card */
}

/* Responsive min-heights */
@media (max-width: 1024px) {
    .quest-card {
        min-height: 420px;
    }
    .quest-card p {
        -webkit-line-clamp: 5;
        line-clamp: 5;
    }
}

@media (max-width: 768px) {
    .quest-card {
        min-height: 440px; /* more height to avoid description cut on mobile */
    }
    .quest-card p {
        -webkit-line-clamp: 6; /* show more lines on mobile */
        line-clamp: 6;
    }
}

/* Extra small phones: allow a bit more space */
@media (max-width: 480px) {
    .quest-card {
        min-height: 460px;
    }
    .quest-card p {
        /* Show full text; remove clamp on very small phones */
        display: block;
        -webkit-line-clamp: unset;
        line-clamp: unset;
        overflow: visible;
    }
}

.quest-xp {
    background: linear-gradient(135deg, var(--orange), var(--yellow));
    color: var(--white);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.9rem;
}

.quest-difficulty {
    color: var(--gray-medium);
    font-weight: 600;
    font-size: 0.9rem;
}

/* Interest Cards */
.interest-option {
    cursor: pointer;
}

.interest-option input[type="checkbox"] {
    display: none;
}

.interest-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between; /* Pour distribuer le contenu verticalement */
    gap: var(--spacing-xs);
    padding: var(--spacing-md);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.1);
    transition: all var(--transition-fast);
    font-size: 0.9rem;
    font-weight: 600;
    position: relative;
    height: 120px; /* Hauteur fixe */
    width: 100%; /* Largeur complète */
    box-sizing: border-box; /* Pour que padding soit inclus dans la hauteur/largeur */
    text-align: center; /* Centrer le texte */
}

.interest-card img {
    width: var(--icon-xl);
    height: var(--icon-xl);
    filter: brightness(0) invert(1);
}

.interest-option input[type="checkbox"]:checked + .interest-card {
    border-color: var(--turquoise-light);
    background: rgba(68, 190, 170, 0.3);
}

/* Grille d'intérêts */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
    width: 100%;
}

@media (max-width: 768px) {
    .interests-grid {
        grid-template-columns: 1fr;
    }
}

/* Mobile: slightly smaller icons to avoid crowding */
@media (max-width: 480px) {
    .interest-card img {
        width: var(--icon-lg);
        height: var(--icon-lg);
    }
}

/* Mobile fine-tune: indent author slightly for better visual balance */
@media (max-width: 480px) {
    .quest-meta {
        align-items: flex-start; /* stack left-aligned on very small screens */
    }
    .quest-creator {
        padding-left: 4px; /* subtle right shift relative to the mode badge */
    }
}

/* Tooltips */
.tooltip-trigger {
    position: relative;
}

.tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--violet-dark);
    color: var(--white);
    padding: var(--spacing-md) var(--spacing-md);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.5;
    white-space: nowrap;
    max-width: 400px;
    width: 350px;
    white-space: normal;
    text-align: center;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-fast);
    z-index: 1000;
    box-shadow: var(--shadow-lg);
    margin-bottom: var(--spacing-sm);
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--violet-dark);
}

.tooltip-trigger:hover .tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Mobile tooltip adjustments */
@media (max-width: 768px) {
    .tooltip {
        max-width: 320px;
        width: 280px;
        font-size: 0.8rem;
        padding: var(--spacing-sm) var(--spacing-md);
    }
}
