/* Achievements Page Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f8f9fa;
}

/* Add this to your index.css file */
.navbar {
    position: sticky;
    top: 0;
    z-index: 1000; /* Ensures navbar stays on top of other content */
}

/* Hero Section */
.achievement-hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("/static/img/bg.jpg");
    background-size: cover;
    background-position: center;
    color: white;
    padding: 80px 0;
    margin-bottom: 40px;
}

/* User Progress */
.user-progress {
    margin-bottom: 40px;
}

.progress-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 25px;
}

.user-level {
    background-color: #0d6efd;
    color: white;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
}

.level-number {
    font-size: 28px;
    font-weight: bold;
    line-height: 1;
}

.level-text {
    font-size: 14px;
}

.progress {
    height: 12px;
    border-radius: 6px;
}

.total-achievements {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.achievements-number {
    font-size: 20px;
    font-weight: bold;
    color: #212529;
}

.achievements-text {
    font-size: 14px;
    color: #6c757d;
}

/* Achievements Section */
.achievements-section {
    padding-bottom: 60px;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
}

    .section-title::after {
        content: '';
        position: absolute;
        width: 60px;
        height: 3px;
        background-color: #0d6efd;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
    }

/* GRID LAYOUT STYLES */
.achievement-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    text-align: center;
    height: 100%;
    position: relative;
    transition: all 0.3s ease;
    overflow: hidden;
}

    .achievement-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    }

.achievement-icon {
    margin-bottom: 15px;
}

    .achievement-icon img {
        width: 80px;
        height: 80px;
        border-radius: 50%;
        object-fit: cover;
    }

.achievement-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-points {
    color: #28a745;
    font-weight: 600;
    margin-bottom: 5px;
}

.achievement-date {
    font-size: 12px;
    color: #6c757d;
}

.achievement-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.achievement-card:hover .achievement-info {
    opacity: 1;
}

/* Locked achievement styling */
.achievement-card.locked {
    background-color: #f8f9fa;
}

.locked .achievement-icon img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.locked .achievement-title,
.locked .achievement-points,
.locked .achievement-date {
    color: #6c757d;
}

/* LIST LAYOUT STYLES */
.achievement-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.achievement-item {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .achievement-item:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    }

    .achievement-item .achievement-info {
        position: relative;
        opacity: 1;
        padding: 0;
        margin-top: 5px;
    }

        .achievement-item .achievement-info p {
            margin-bottom: 0;
            font-size: 14px;
            color: #6c757d;
        }

.achievement-meta {
    text-align: right;
}

.achievement-item.locked {
    background-color: #f8f9fa;
}

    .achievement-item.locked .achievement-icon img {
        filter: grayscale(100%);
        opacity: 0.5;
    }

    .achievement-item.locked .achievement-title,
    .achievement-item.locked .achievement-points,
    .achievement-item.locked .achievement-date {
        color: #6c757d;
    }

/* TIMELINE LAYOUT STYLES */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

    .timeline::before {
        content: '';
        position: absolute;
        width: 2px;
        background-color: #e9ecef;
        top: 0;
        bottom: 0;
        left: 50%;
        margin-left: -1px;
    }

.timeline-item {
    padding: 15px 0;
    position: relative;
}

.timeline-date {
    position: absolute;
    width: 120px;
    text-align: right;
    padding: 5px 10px;
    background-color: #f8f9fa;
    border-radius: 20px;
    left: calc(50% - 140px);
    top: 30px;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.timeline-content {
    position: relative;
    width: calc(50% - 40px);
    margin-left: calc(50% + 40px);
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    padding: 20px;
    transition: all 0.3s ease;
}

    .timeline-content:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    }

    .timeline-content::before {
        content: '';
        position: absolute;
        top: 30px;
        left: -8px;
        width: 16px;
        height: 16px;
        background-color: white;
        transform: rotate(45deg);
    }

.timeline-icon {
    margin-right: 15px;
}

    .timeline-icon img {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
    }

.timeline-body {
    flex-grow: 1;
}

    .timeline-body .achievement-info {
        position: relative;
        opacity: 1;
        padding: 0;
        margin-top: 10px;
    }

        .timeline-body .achievement-info p {
            margin-bottom: 0;
            font-size: 14px;
            color: #6c757d;
        }

.timeline-item.locked .timeline-content {
    background-color: #f8f9fa;
}

.timeline-item.locked .timeline-icon img {
    filter: grayscale(100%);
    opacity: 0.5;
}

.timeline-item.locked .achievement-title,
.timeline-item.locked .achievement-points {
    color: #6c757d;
}

.achievement-summary {
    background-color: #e9ecef;
    display: inline-block;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 500;
    color: #495057;
}

/* Even-numbered timeline items styling - appear on left side */
.timeline-item:nth-child(even) .timeline-date {
    left: auto;
    right: calc(50% - 140px);
    text-align: left;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-left: 0;
    margin-right: calc(50% + 40px);
    width: calc(50% - 40px);
}

    .timeline-item:nth-child(even) .timeline-content::before {
        left: auto;
        right: -8px;
    }

/* Footer */
.footer {
    background-color: #343a40;
    color: white;
    padding: 30px 0;
}

    .footer a {
        text-decoration: none;
        color: white;
        transition: opacity 0.3s;
    }

        .footer a:hover {
            opacity: 0.8;
        }

/* Responsive Adjustments */
@media (max-width: 992px) {
    .timeline::before {
        left: 40px;
    }

    .timeline-date {
        left: 0;
        text-align: left;
        width: 100px;
    }

    .timeline-content {
        width: calc(100% - 100px);
        margin-left: 100px;
    }

    .timeline-item:nth-child(even) .timeline-date {
        left: 0;
        right: auto;
    }

    .timeline-item:nth-child(even) .timeline-content {
        margin-left: 100px;
        margin-right: 0;
        width: calc(100% - 100px);
    }

        .timeline-item:nth-child(even) .timeline-content::before {
            left: -8px;
            right: auto;
        }
}

@media (max-width: 768px) {
    .user-level, .total-achievements {
        margin-bottom: 20px;
    }

    .achievement-hero {
        padding: 60px 0;
    }

    .timeline::before {
        display: none;
    }

    .timeline-date {
        position: relative;
        top: 0;
        margin-bottom: 10px;
        border-radius: 4px;
        left: 0;
    }

    .timeline-content {
        width: 100%;
        margin-left: 0;
    }

        .timeline-content::before {
            display: none;
        }

    .timeline-item:nth-child(even) .timeline-date {
        right: auto;
    }

    .timeline-item:nth-child(even) .timeline-content {
        margin-right: 0;
        width: 100%;
    }
}
