/* ========================================
   Chasse au Trésor - Main Styles
   ======================================== */

:root {
    --ctg-primary: #846249;
    --ctg-secondary: #28bc28;
    --ctg-bg-light: #fdfdfd;
    --ctg-card-shadow: 0 10px 25px rgba(0,0,0,0.1);
    --ctg-diff-facile: #719e71;
    --ctg-diff-normal: #8d7361;
    --ctg-diff-expert: #726258;
}

.ctg-hunts-grid-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Comfortaa', sans-serif;
    box-sizing: border-box;
}

/* Header Info */
.ctg-hunts-header-info {
    display: flex;
    background: #c3a18a;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    color: white;
    box-shadow: var(--ctg-card-shadow);
    align-items: center;
}

.ctg-hunts-intro-card {
    flex: 1;
    z-index: 2;
}

.ctg-hunts-intro-card p {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.ctg-how-it-works {
    display: inline-block;
    background: var(--ctg-secondary);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: bold;
    transition: transform 0.3s ease;
}

.ctg-how-it-works:hover {
    transform: translateX(5px);
}

.ctg-hunts-mascot {
    width: 200px;
    margin-left: 20px;
    z-index: 2;
}

.ctg-hunts-mascot img {
    max-width: 100%;
    height: auto;
}

/* Filters Row */
.ctg-filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.ctg-difficulty-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ctg-filter-btn {
    border: none;
    border-radius: 25px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: bold;
    cursor: pointer;
    background: #eee;
    color: #666;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.ctg-filter-btn.active {
    box-shadow: 0 0 0 4px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ctg-filter-btn[data-filter="facile"].active { background-color: var(--ctg-diff-facile); color: white; }
.ctg-filter-btn[data-filter="normal"].active { background-color: var(--ctg-diff-normal); color: white; }
.ctg-filter-btn[data-filter="expert"].active { background-color: var(--ctg-diff-expert); color: white; }

.ctg-filter-btn span {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 4px;
    display: inline-block;
}

.ctg-filter-btn.active span {
    border-color: white;
}

.ctg-btn-progression {
    border: 2px solid #333;
    padding: 10px 25px;
    border-radius: 30px;
    text-decoration: none;
    color: #333;
    font-weight: bold;
    transition: all 0.3s;
}

.ctg-btn-progression:hover {
    background: #333;
    color: white;
}

/* Grid */
.ctg-hunts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 25px;
}

.ctg-hunt-card {
    border-radius: 20px;
    overflow: hidden;
    height: 300px;
    box-shadow: var(--ctg-card-shadow);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ctg-hunt-card:hover {
    transform: translateY(-10px);
}

.ctg-hunt-card-image {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.ctg-hunt-price-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0,0,0,0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 3;
}

.ctg-star { color: #f1c40f; }

.ctg-hunt-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    text-align: center;
    height: 40%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

.ctg-hunt-card-overlay h3 {
    font-family: 'Poetsen One', cursive;
    font-size: 1.5rem;
    margin-bottom: 30px;
    line-height: 1.2;
    color: white;
}

.ctg-hunt-card-actions {
    margin-top: auto;
}

.ctg-hunt-info-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: white;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    transition: transform 0.3s;
    margin: 0 auto;
}

.ctg-hunt-info-btn:hover {
    transform: scale(1.1);
}

/* Specific Game View Styles */
.ctg-game {
    max-width: 900px;
    margin: 20px auto;
    padding: 0 15px;
    box-sizing: border-box;
}

.ctg-header h2 {
    font-family: 'Poetsen One', sans-serif;
    font-size: clamp(1.4rem, 5vw, 2.5rem);
    margin-bottom: 20px;
    color: var(--ctg-primary);
}

.ctg-progress-bar-container {
    background: #eee;
    border-radius: 10px;
    height: 25px;
    position: relative;
    overflow: hidden;
    margin-bottom: 40px;
}

.ctg-progress-bar {
    background: var(--ctg-secondary);
    height: 100%;
    transition: width 0.5s ease-out;
}

.ctg-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.9rem;
    font-weight: bold;
    color: #333;
}

.ctg-steps-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ctg-step-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    display: flex;
    gap: 15px;
    box-shadow: var(--ctg-card-shadow);
    border-left: 5px solid #ddd;
    box-sizing: border-box;
    min-width: 0;
}

.ctg-step-card.completed {
    border-left-color: var(--ctg-secondary);
}

.ctg-step-icon {
    width: 60px;
    height: 60px;
    background: #f5f5f5;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-weight: bold;
    font-size: 1.2rem;
}

.ctg-step-card.completed .ctg-step-icon {
    background: var(--ctg-secondary);
    color: white;
}

/* Modal and Utilities */
.ctg-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.ctg-modal-content {
    background: white;
    padding: 40px;
    border-radius: 20px;
    max-width: 500px;
    text-align: center;
}

#ctg-modal-close {
    margin-top: 20px;
    background: var(--ctg-primary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
}

/* PDF section heading color */
.ctg-pdf-section h3 {
    color: #e67e22 !important ;
}

/* Button Styles */
.ctg-back-link {
    display: inline-flex;
    align-items: center;
    padding: 8px 15px;
    background: rgba(255, 255, 255, 0.8);
    color: var(--ctg-primary);
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

.ctg-back-link:hover {
    background: white;
    transform: translateX(-5px);
    color: var(--ctg-secondary);
}

.ctg-validate-btn {
    background: var(--ctg-secondary);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 188, 40, 0.3);
    margin-top: 15px;
    display: inline-block;
}

.ctg-validate-btn:hover {
    background: #21a021;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 188, 40, 0.4);
}

.ctg-validate-btn:active {
    transform: translateY(0);
}

.ctg-badge-success {
    display: inline-flex;
    align-items: center;
    background: rgba(40, 188, 40, 0.1);
    color: var(--ctg-secondary);
    border: 2px solid var(--ctg-secondary);
    padding: 8px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 0.95rem;
    margin-top: 15px;
}

@media (max-width: 768px) {
    .ctg-hunts-grid-wrapper {
        padding: 12px;
    }

    .ctg-hunts-header-info {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        margin-bottom: 20px;
    }

    .ctg-hunts-intro-card p {
        font-size: 1rem;
    }

    .ctg-hunts-mascot {
        margin: 15px auto 0;
        width: 140px;
    }

    .ctg-filters-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .ctg-difficulty-filters {
        flex-wrap: wrap;
        gap: 8px;
        width: 100%;
    }

    .ctg-filter-btn {
        padding: 8px 14px;
        font-size: 0.85rem;
    }

    .ctg-btn-progression {
        width: 100%;
        text-align: center;
        display: block;
        padding: 10px 20px;
        box-sizing: border-box;
    }

    .ctg-hunts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .ctg-hunt-card {
        height: 220px;
    }

    .ctg-hunt-card-overlay h3 {
        font-size: 1rem;
        margin-bottom: 15px;
    }

    .ctg-hunt-info-btn {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    /* Game view */
    .ctg-game {
        margin: 10px auto;
        padding: 0 10px;
    }

    .ctg-step-card {
        flex-direction: row;
        padding: 15px;
        gap: 12px;
    }

    .ctg-step-icon {
        width: 45px;
        height: 45px;
        font-size: 1rem;
        flex-shrink: 0;
    }

    .ctg-step-content {
        min-width: 0;
        flex: 1;
    }

    .ctg-modal-content {
        margin: 20px;
        padding: 25px 20px;
    }
}

@media (max-width: 400px) {
    .ctg-hunts-grid {
        grid-template-columns: 1fr;
    }

    .ctg-hunt-card {
        height: 200px;
    }
}
