/*
 * achievements.css
 * Styles specific to the achievements page (achievements.html).
 * Only shows unlocked achievements, grouped by category.
 */

/* Instructions paragraph styling */
.instructions {
    margin-bottom: 25px;
    color: #555; /* Slightly muted text color */
    line-height: 1.6; /* Improve readability */
    font-size: 1em;
    text-align: center;
}

/* --- Category Section Styles --- */
.achievement-category-section {
    margin-bottom: 30px; /* Space between category sections */
    padding-bottom: 20px; /* Padding at the bottom of the section */
    border-bottom: 2px solid #e0e0e0; /* Separator line between categories */
}

.achievement-category-section:last-child {
    border-bottom: none; /* Remove border from the last section */
    margin-bottom: 0;
    padding-bottom: 0;
}

.achievement-category-heading {
    font-size: 1.4rem; /* Slightly larger heading */
    color: #2c3e50; /* Dark blue color */
    text-align: left; /* Align heading to the left */
    margin-top: 0; /* Remove default top margin */
    margin-bottom: 15px; /* Space below the heading */
    padding-bottom: 5px; /* Space under the text */
    border-bottom: 1px solid #bdc3c7; /* Subtle underline */
}

/* Container for the grid of achievements within a category */
.achievements-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 20px; /* Spacing between achievement items */
    padding: 10px 0; /* Reduced padding as section has padding now */
}

/* Styling for the message shown when a category has no earned achievements */
.no-category-achievements {
    grid-column: 1 / -1; /* Make the message span the full grid width */
    text-align: center;
    color: #7f8c8d; /* Muted grey color */
    font-style: italic;
    padding: 20px 0; /* Add some padding */
}

/* Individual achievement item styling */
.achievement-item {
    background-color: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    opacity: 1;
}

.achievement-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.achievement-badge {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    filter: none;
    transition: filter 0.3s ease;
}

.achievement-item h3 {
    font-size: 1.1em;
    color: #333;
    margin: 10px 0 5px 0;
    word-wrap: break-word;
    line-height: 1.2;
}

.achievement-item .achievement-subname {
    font-size: 0.85em;
    color: #666;
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
}

.achievement-item.unlocked {
    border-color: #1abc9c;
}

.achievement-item.unlocked:hover .achievement-badge {
     filter: drop-shadow(0 0 3px rgba(26, 188, 156, 0.7));
}

/* --- Achievement Modal Styles --- */

.modal-overlay {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    visibility: hidden;
}

.modal-content.achievement-modal-content {
    background-color: #fff;
    padding: 25px 35px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 90%;
    max-width: 450px;
    text-align: center;
    position: relative;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content.achievement-modal-content {
    transform: scale(0.95);
}

/* Optional Modal Title (if you re-add the h2) */
/* .achievement-modal-content h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.4rem;
} */

/* --- NEW: Modal Badge Image Style --- */
.modal-badge-image {
    display: block; /* Center the image */
    margin: 0 auto 15px auto; /* Center horizontally, add space below */
    width: 240px; /* Adjust size as needed */
    height: 240px;
    max-width: 320px; /* Respect user request */
    max-height: 320px; /* Respect user request */
    object-fit: contain; /* Scale nicely */
}

/* --- NEW: Modal Achievement Name Style --- */
#achievement-modal-name {
    font-size: 1.3em;
    font-weight: bold;
    color: #333;
    margin-top: 0; /* Remove potential top margin */
    margin-bottom: 10px; /* Space below the name */
}

/* Modal Description Text */
#achievement-modal-description {
    font-size: 1rem;
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px; /* Add space before the share button */
}

.modal-close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    transition: color 0.2s ease;
}

.modal-close-button:hover,
.modal-close-button:focus {
    color: #333;
    text-decoration: none;
    outline: none;
}

/* --- Modal Share Area --- */
.modal-share-area {
    margin-top: 20px; /* Space above the share button */
    padding-top: 15px; /* Padding above the share button */
    border-top: 1px solid #eee; /* Separator line */
}

.modal-share-button {
    background-color: #9b59b6; /* Purple */
    color: white;
    padding: 10px 20px;
    font-size: 1em;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-bottom: 10px; /* Space below the button */
}

.modal-share-button:hover {
    background-color: #8e44ad; /* Darker Purple */
}

#achievement-modal-share-feedback {
    font-size: 0.9em;
    font-style: italic;
    color: #555;
    min-height: 1.2em; /* Prevent layout shift */
    margin: 0;
    padding: 0;
}

/* --- Utility Classes --- */
.hidden {
    display: none !important;
}

.error-message {
    color: #e74c3c;
    font-weight: bold;
    text-align: center;
    padding: 20px;
}
