/* ===================================================================
 * Achievements Page General Styling
 * =================================================================== */
#achievements-dashboard {
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}

#achievements-dashboard .section-title {
    margin-top: 0;
    border-bottom: 2px solid #963d5a;
    padding-bottom: 10px;
    color: #333;
}

/* ===================================================================
 * Achievements Grid
 * =================================================================== */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.achievement-card {
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
}

.achievement-icon {
    position: relative;
    width: 80px;
    height: 80px;
    margin: 0 auto 10px auto;
    border-radius: 50%;
    background-color: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.achievement-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.achievement-title {
    font-size: 14px;
    color: #444;
    margin: 0;
    line-height: 1.3;
}

/* ===================================================================
 * Badge Status Styling
 * =================================================================== */
.status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
}

.status-overlay .status-icon::before {
    font-family: 'dashicons'; /* Using WordPress Dashicons */
    font-size: 36px;
    color: #333;
}

/* Locked State */
.achievement-card.locked .achievement-icon img {
    filter: grayscale(100%);
}
.achievement-card.locked .status-overlay {
    background-color: rgba(50, 50, 50, 0.6);
}
.achievement-card.locked .status-icon::before {
    content: "\f160"; /* Dashicon for lock */
    color: #fff;
}

/* Claimable State */
.achievement-card.claimable {
    border-color: #963d5a;
    box-shadow: 0 0 15px rgba(150, 61, 90, 0.3);
}
.achievement-card.claimable .status-overlay {
    background-color: rgba(150, 61, 90, 0.7);
}
.achievement-card.claimable .status-icon::before {
    content: "\f155"; /* Dashicon for star-filled */
    color: #fff;
    animation: pulse 1.5s infinite;
}

/* Claimed State */
.achievement-card.claimed .status-overlay {
    background-color: rgba(46, 178, 77, 0.7);
}
.achievement-card.claimed .status-icon::before {
    content: "\f147"; /* Dashicon for checkmark */
    color: #fff;
}


/* ===================================================================
 * Modal (Popup) Styling
 * =================================================================== */
.achievement-modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    position: relative;
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
    animation: slideIn 0.4s;
}

.close-button {
    color: #aaa;
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}
.close-button:hover,
.close-button:focus {
    color: #000;
}

.modal-header {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

#modal-badge-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin-right: 20px;
}

#modal-badge-name {
    margin: 0;
    font-size: 24px;
}

#modal-badge-desc {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

#modal-claim-area {
    margin-top: 25px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 5px;
    border: 1px solid #eee;
}

#modal-claim-area .journey-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
}

#modal-claim-area .button-claim-badge {
    width: 100%;
    padding: 12px;
    font-size: 16px;
    background-color: #963d5a;
    border-color: #81344d;
    color: #fff;
    transition: background-color 0.2s;
}
#modal-claim-area .button-claim-badge:hover:not(:disabled) {
    background-color: #81344d;
}
#modal-claim-area .button-claim-badge:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* Feedback message styling (used on page and in modal) */
.feedback-message {
    padding: 15px;
    margin-top: 15px;
    border-radius: 5px;
    display: none; /* Initially hidden */
}
.feedback-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
.feedback-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

/* ===================================================================
 * Animations & Responsive Design
 * =================================================================== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

@media (max-width: 600px) {
    .achievements-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 15px;
    }

    .modal-content {
        margin: 20% auto;
    }
}