/**
 * ACHIEVEMENTS COMPONENT
 * 
 * Styles for the achievements section
 * Previously these styles were scattered across multiple CSS files
 * including updates.css, styles.css, and responsive.css.
 * 
 * Organization:
 * - Main achievement section layout
 * - Achievement cards styling
 * - Other achievements grid and items
 * - Dark mode support
 * - Responsive styles
 */

/* Main Achievements Section */
.achievements.section {
    padding: 4rem 0;
}

/* Achievements Wrapper - Two-column grid for main achievement cards */
.achievements-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* More responsive grid */
    gap: 2.5rem;
    margin: 2.5rem 0 3.5rem;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

/* Main Achievement Cards */
.achievement-card {
    background-color: var(--card-bg);
    border-radius: 16px; /* Softer radius */
    box-shadow: var(--shadow-elevation-medium);
    overflow: hidden;
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    display: flex;
    flex-direction: column;
    position: relative;
    border: 1px solid var(--border-color-light, #e0e0e0); /* Lighter border */
}

.achievement-card:hover {
    transform: translateY(-8px); /* More pronounced lift */
    box-shadow: var(--shadow-elevation-high);
}

/* Achievement Image Container - Now a background holder */
.achievement-image {
    width: 100%;
    height: 350px; /* Increased height for better visuals */
    position: relative;
    background-size: cover;
    background-position: center center; /* Default for all cards */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.5rem;
    box-sizing: border-box;
}

/* Specific adjustment for the first achievement card image */
.achievement-card:first-child .achievement-image {
    background-position: center 20%; /* Adjust to prevent face cut-off */
}

/* Add a gradient overlay for text readability on image */
.achievement-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.75) 100%); /* Adjusted gradient */
    z-index: 1;
    border-radius: 16px 16px 0 0; /* Match card's top border radius */
}

/* Hide the img tag if using background-image approach */
.award-img {
    display: none; /* Hidden as image is now a background */
}

/* Achievement Overlay - Integrated into .achievement-image */
.achievement-overlay {
    position: relative; /* No longer absolute, part of .achievement-image flex */
    z-index: 2; /* Above the gradient */
    color: white;
    text-align: left; /* Align text to the left */
    width: 100%;
    padding: 0; /* Padding is now on .achievement-image */
    background-color: transparent; /* No separate background */
}

/* Achievement Title */
.achievement-title {
    font-size: 1.75rem; /* Larger title */
    font-weight: 700;
    margin: 0 0 0.35rem 0;
    color: #ffffff; /* Ensure pure white for contrast */
    text-align: left;
    padding: 0; /* Padding is on .achievement-image */
    line-height: 1.25; /* Adjusted line height */
    text-shadow: 1px 1px 3px rgba(0,0,0,0.5); /* Subtle text shadow */
}

/* Achievement Year - More subtle */
.achievement-year {
    background-color: rgba(255, 255, 255, 0.15); /* Slightly more visible background */
    color: #f0f0f0; /* Light greyish white */
    padding: 0.3rem 0.75rem; /* Adjusted padding */
    font-weight: 500;
    font-size: 0.85rem; /* Slightly smaller */
    display: inline-block; /* Changed display */
    text-align: left;
    margin-top: 0.25rem; /* Added some top margin */
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px; /* Softer radius */
}

/* Achievement Details Container */
.achievement-details {
    padding: 1.75rem; /* Increased padding */
    display: flex;
    flex-direction: column;
    flex: 1;
    background-color: var(--card-bg); /* Ensure this matches card background */
}

/* Achievement Organization */
.achievement-organization {
    font-size: 0.95rem; /* Adjusted size */
    font-weight: 600; /* Slightly bolder */
    color: var(--primary-color-dark, var(--primary-color)); /* Darker shade of primary or primary */
    margin: 0 0 0.75rem 0; /* Adjusted margin */
}

/* Achievement Description */
.achievement-description {
    font-size: 0.9rem; /* Standardized size */
    line-height: 1.75; /* Increased line-height for readability */
    color: var(--text-color-medium, var(--text-color)); /* Medium text color */
    margin: 0 0 1.75rem 0; /* Adjusted margin */
    flex-grow: 1;
}

/* Add subtle entrance animation for achievements */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.achievement-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.achievement-card:nth-child(2) {
    animation-delay: 0.2s;
}

/* Fix for dark mode */
body.dark-theme .achievement-card{
    background-color: #333;
    border-color: rgba(255, 255, 255, 0.1);
}

body.dark-theme .achievement-image {
    background-color: #2a2a2a;
}

body.dark-theme .achievement-title {
    color: #fff;
}

body.dark-theme .achievement-organization,
body.dark-theme .achievement-description {
    color: #ddd;
}

body.dark-theme .achievement-tag {
    background-color: rgba(67, 97, 238, 0.2);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .achievements-wrapper {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    
    .achievement-image {
        height: 180px;
    }

}

/* Make tag colors consistent with design */
.achievement-tag:nth-child(1) {
    background-color: rgba(67, 97, 238, 0.1);
    color: var(--primary-color);
}

.achievement-tag:nth-child(1) i {
    color: var(--primary-color);
}

.achievement-tag:nth-child(2) {
    background-color: rgba(238, 67, 97, 0.1);
    color: #ee4361;
}

.achievement-tag:nth-child(2) i {
    color: #ee4361;
}

.achievement-tag:nth-child(3) {
    background-color: rgba(67, 238, 164, 0.1);
    color: #43eea4;
}

.achievement-tag:nth-child(3) i {
    color: #43eea4;
}

.achievement-tag:nth-child(4) {
    background-color: rgba(238, 201, 67, 0.1);
    color: #eec943;
}

.achievement-tag:nth-child(4) i {
    color: #eec943;
}
