﻿
/* Badges stilar som liknar Untappd */

/* Huvudbehållare */
.badges-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Rubriker */
.badges-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

    .badges-header h3 {
        font-size: 1.75rem;
        font-weight: 700;
        margin: 0;
        color: #333;
    }

/* Filtreringssektion */
.badges-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 1rem;
}

    .badges-filter a {
        padding: 0.5rem 1rem;
        text-decoration: none;
        color: #666;
        border-radius: 0.5rem;
        font-weight: 500;
        transition: all 0.2s ease;
    }

        .badges-filter a:hover {
            background-color: #f0f0f0;
        }

        .badges-filter a.active {
            color: #fff;
            background-color: #F97316;
        }

/* Sorteringssektion */
.badges-toggle {
    margin-bottom: 1.5rem;
}

.badge-sort {
    padding: 0.5rem;
    border-radius: 0.25rem;
    border: 1px solid #ddd;
    width: 100%;
    max-width: 300px;
    font-size: 0.9rem;
}

/* Badge-kategorirubrik */
.badges-category {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.5rem 0 1rem;
    color: #555;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

/* Badge-grid */
.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
}

/* Enskild badge-item */
.badge-item {
    text-align: center;
    position: relative;
    transition: transform 0.2s ease;
    border: 1px solid #eee;
    border-radius: 0.75rem;
    padding: 1rem;
    background-color: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

    .badge-item:hover {
        transform: translateY(-5px);
        box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    }

    .badge-item a {
        display: block;
        text-decoration: none;
        color: inherit;
    }

    .badge-item img {
        width: 100%;
        max-width: 100px;
        height: auto;
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        margin: 0 auto 0.75rem;
    }

    .badge-item .badge-name {
        font-size: 1rem;
        font-weight: 700;
        margin: 0.5rem 0 0.25rem;
        color: #333;
        line-height: 1.3;
    }

    .badge-item .badge-description {
        font-size: 0.85rem;
        color: #666;
        margin: 0.25rem 0 0.75rem;
        line-height: 1.4;
    }

    .badge-item .badge-date {
        font-size: 0.75rem;
        color: #999;
        margin: 0.5rem 0 0;
        font-style: italic;
    }

/* Level-box */
.level-box {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background-color: #9b87f5;
    color: white;
    font-weight: bold;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    border: 2px solid white;
    z-index: 2;
}

/* Visa fler-knapp */
.view-more-btn {
    display: block;
    margin: 2rem auto 0;
    padding: 0.75rem 1.5rem;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    color: #666;
    font-weight: 600;
    border-radius: 0.5rem;
    text-align: center;
    max-width: 200px;
    transition: all 0.2s ease;
}

    .view-more-btn:hover {
        background-color: #e9ecef;
        color: #333;
    }

/* Responsiv design */
@media (max-width: 768px) {
    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 1rem;
    }

    .badges-filter {
        flex-direction: column;
    }

        .badges-filter a {
            text-align: center;
        }
}

/* Stilar för tillgänglighet */
.badge-item a:focus {
    outline: 2px solid #9b87f5;
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Stilar för "level" badges */
.badge-item.level {
    position: relative;
}
