/* ========== Achievements Page Specific Styles ========== */

/* 
 * FIX 1: Aggressively override the global .section padding.
 * We set it to 0 so we have full control over the spacing on this page.
 */
main .section {
    padding: 0 2rem !important;
}

/* 
 * FIX 2: Add clearance ONLY for the very first section to clear the fixed header.
 * Reduced from 100px to 80px to minimize empty space at the top.
 */
main > .section:first-of-type {
    padding-top: 80px !important; 
    padding-bottom: 1rem !important;
}

/* Tighten the header margin */
.section-header {
    margin-bottom: 2rem;
}

/* Stats Bar */
.stats-bar {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.stat-box {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.5rem 2.5rem;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-box::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-box:hover::after {
    transform: scaleX(1);
}

.stat-box:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
}

.stat-number {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.25rem;
    line-height: 1;
}

.stat-text {
    font-size: 0.85rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Filters */
.filter-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 2rem;
}

.filter-container {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
    background: var(--bg-secondary);
    padding: 0.5rem;
    border-radius: 50px;
    border: 1px solid var(--border);
}

.filter-btn {
    background: transparent;
    border: none;
    color: var(--muted);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    color: var(--fg);
    background: rgba(255, 255, 255, 0.05);
}

.filter-btn.active {
    background: var(--accent);
    color: var(--bg);
    box-shadow: 0 0 15px var(--glow);
}

/* Certificate Grid */
.cert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 4rem;
}

/* Ensure cards render immediately without scroll animation delay */
.cert-card.reveal {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Certificate Card - "King/Premium" Style */
.cert-card {
    background: linear-gradient(145deg, var(--card) 0%, rgba(18, 20, 26, 0.95) 100%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.75rem;
    padding-top: 2rem; /* Extra padding at top to clear the ribbon */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* 
 * The "Ribbon" - Fixed position at absolute top.
 * Uses z-index to stay above the background gradient but below text content if needed.
 */
.cert-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 6px; /* Thick ribbon */
    background: linear-gradient(90deg, #00d9b5, #00ffcc, #00d9b5);
    border-radius: 16px 16px 0 0; /* Matches card corners */
    z-index: 2; /* Sits on top */
}

/* The "Verified" Star Icon in corner */
.cert-card::after {
    content: '★';
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 2.5rem;
    color: var(--accent);
    opacity: 0.08;
    transition: all 0.3s ease;
    transform: rotate(15deg);
    z-index: 0;
}

.cert-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3), 0 0 30px rgba(0, 217, 181, 0.15);
    border-color: rgba(0, 217, 181, 0.4);
}

.cert-card:hover::after {
    opacity: 0.3;
    transform: rotate(0deg) scale(1.1);
}

.cert-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1; /* Ensures text is above the star/ribbon */
}

.cert-issuer {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffd700; /* Gold for prestige */
    font-weight: 700;
    background: rgba(255, 215, 0, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    border: 1px solid rgba(255, 215, 0, 0.2);
}

.cert-date {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.cert-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    line-height: 1.4;
    position: relative;
    z-index: 1;
}

.cert-id {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--muted);
    background: var(--bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    align-self: flex-start;
    margin-bottom: 1rem;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
}

.cert-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    border-top: 1px solid var(--border);
    padding-top: 1.25rem;
    position: relative;
    z-index: 1;
}

.cert-link {
    font-size: 0.85rem;
    color: var(--accent);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.cert-link:hover {
    gap: 0.75rem;
    color: #00ffcc;
}

.cert-link svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
}

.cert-link:hover svg {
    transform: translateX(2px);
}

/* Responsive */
@media (max-width: 600px) {
    main > .section:first-of-type {
        padding-top: 90px !important;
    }
    
    .filter-container {
        border-radius: 16px;
        padding: 0.75rem;
    }
    
    .stats-bar {
        gap: 1rem;
    }
    
    .stat-box {
        width: 100%;
        max-width: 300px;
    }

    .cert-grid {
        grid-template-columns: 1fr;
    }
}
