@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap');

:root {
    --primary-red: #C8102E;
    --highlight-cyan: #00B4D8;
    --dark-navy: #0F172A;
    --success-green: #22C55E;
    --bg-white: #FFFFFF;
    --bg-soft-gray: #F8FAFC;
    --font-family: 'Montserrat', sans-serif;
    --gold: #D4AF37;
    --neon-green: #39FF14;
    --charcoal-gray: #121212;
}

.achievements-page {
    font-family: var(--font-family);
    background-color: var(--bg-soft-gray);
    margin: 0;
    padding: 0;
    color: var(--dark-navy);
}

/* Component 1: Hero Section */
.hero-section {
    position: relative;
    width: 100%;
    height: 600px; /* Increased to show more background */
    background-color: var(--dark-navy); /* Base color to prevent white gaps */
    background: linear-gradient(rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.3)), url('../images/background.png') center/cover no-repeat;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding-top: 100px;
    overflow: hidden;
}

.hero-content {
    text-align: center;
    z-index: 2;
}

.hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: #FFF;
    text-transform: uppercase;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.2;
}

.hero-title .red { color: var(--primary-red); }
.hero-title .cyan { color: var(--highlight-cyan); }

.hero-wave {
    position: absolute;
    bottom: -1px; /* Avoid gap */
    left: 0;
    width: 100%;
    line-height: 0;
}

.hero-wave svg {
    display: block;
    width: 100%;
    height: auto;
}

/* Component 2: Profile Card */
.profile-card-container {
    position: relative;
    max-width: 800px;
    margin: -40px auto 60px; /* Reduced negative margin from -120px to shift content down */
    padding: 0 20px;
    z-index: 10;
}

.profile-card {
    background: var(--bg-white);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 80px 40px 40px;
    text-align: center;
    position: relative;
}

.profile-card-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0; /* Let content overflow for positioning */
}

.profile-card-actions {
    position: absolute;
    top: 25px;
    right: 25px;
    display: flex;
    gap: 10px;
    z-index: 20;
}

/* Specific styling for the profile action buttons */
.profile-card-actions .icon-btn {
    background: #F1F5F9 !important;
    border: none !important;
    border-radius: 50% !important;
    width: 36px !important;
    height: 36px !important;
    padding: 0 !important;
    color: #64748B !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05) !important;
    display: none !important; /* Hidden by default */
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s ease !important;
}

/* Toggle visibility via parent class */
.profile-card-actions .profile-edit-btn {
    display: flex !important;
}

.profile-card.is-editing-all .profile-edit-btn {
    display: none !important;
}

.profile-card.is-editing-all .profile-save-btn {
    display: flex !important;
}

.profile-card-actions .icon-btn:hover {
    background: var(--highlight-cyan) !important;
    color: #FFF !important;
    transform: translateY(-2px) !important;
}

.profile-card-actions .icon-btn.profile-save-btn:hover {
    background: var(--success-green) !important;
}

.profile-card-actions .icon-btn svg {
    width: 18px !important;
    height: 18px !important;
}




.avatar-container {
    position: absolute;
    top: -70px;
    left: 50%;
    transform: translateX(-50%);
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 6px solid var(--highlight-cyan);
    background: #E2E8F0;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.avatar-container svg {
    width: 100%;
    height: 100%;
    color: #94A3B8;
}

.profile-subtitle {
    color: var(--highlight-cyan);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 25px;
    text-transform: uppercase;
}

.profile-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 500px;
    margin: 0 auto;
}

.profile-row {
    display: flex;
    align-items: center; /* Vertical alignment */
    gap: 20px;
    text-align: left;
    padding: 12px 0;
    border-bottom: 1px solid #F1F5F9;
}

.profile-row:last-child {
    border-bottom: none;
}

.profile-row-icon {
    color: var(--highlight-cyan);
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.profile-row-label {
    color: var(--highlight-cyan);
    font-weight: 700;
    width: 160px; /* Fixed width for alignment */
    flex-shrink: 0;
}

.profile-row-value {
    color: #475569;
    font-weight: 400;
    flex-grow: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Editable inputs style */
.profile-input {
    width: 100%;
    border: 1px solid #E2E8F0;
    background: #F8FAFC;
    padding: 8px 12px;
    font-family: inherit;
    font-size: 0.95rem;
    color: #1E293B;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: none; /* Hidden until edit mode */
    margin: 0;
}

.profile-input.is-invalid {
    border-color: var(--primary-red) !important;
    background-color: #FFF5F5 !important;
}

.error-message {
    color: var(--primary-red);
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 4px;
    display: none; /* Shown via JS */
}

.profile-row.has-error .error-message {
    display: block;
}



.profile-input:focus {
    outline: none;
    background: #FFF;
    border-color: var(--highlight-cyan);
    box-shadow: 0 0 0 2px rgba(0, 180, 216, 0.1);
}

.profile-display-value {
    font-size: 1rem;
    color: #475569;
    flex-grow: 1;
}

.height-conversion-hint {
    font-size: 0.85rem;
    color: var(--highlight-cyan);
    font-weight: 600;
    margin-top: 4px;
    display: none; /* Hidden by default */
}

/* Edit Mode Toggle Classes */
.profile-row.is-editing .profile-input {
    display: block;
}
.profile-row.is-editing .profile-display-value {
    display: none;
}
.profile-row.is-editing .height-conversion-hint {
    display: block; /* Show hint when editing */
}




/* Component 3: Progress Section (Polished Professional Design) */
.progress-section-minimal {
    max-width: 1200px; /* Even wider */
    margin: 80px auto;
    padding: 0 20px;
}

.progress-card-minimal {
    background: var(--bg-white);
    border-radius: 16px;
    padding: 60px 80px; /* More padding */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); /* More prominent shadow */
    text-align: center;
    border: 1px solid #F1F5F9;
    border-top: 5px solid var(--primary-red); /* Premium accent line */
    position: relative;
}

.progress-header-minimal {
    margin-bottom: 35px;
}

.progress-header-minimal h2 {
    font-size: 2.2rem; /* Larger title */
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
}

.progress-header-minimal .red { color: var(--primary-red); }
.progress-header-minimal .blue { color: var(--highlight-cyan); } /* Matching Hero Cyan */
.progress-header-minimal .slate { color: #334155; }

.progress-stats-minimal {
    margin-bottom: 40px;
}

.stats-readout-minimal {
    font-size: 6rem; /* Huge, high-impact numbers */
    font-weight: 800;
    color: #1E293B;
    line-height: 1;
    margin-bottom: 15px;
    letter-spacing: -2px;
}

.stats-labels-minimal {
    display: flex;
    justify-content: center;
    gap: 80px;
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.progress-bar-minimal-wrapper {
    max-width: 800px;
    margin: 0 auto 35px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.progress-bar-minimal-track {
    flex-grow: 1;
    height: 16px; /* Taller bar */
    background: #F1F5F9;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.progress-bar-minimal-fill {
    height: 100%;
    background: linear-gradient(90deg, #22C55E, #00B4D8);
    width: 0;
    border-radius: 8px;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
    position: relative;
    overflow: hidden;
}

.bar-edge-number {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1E293B;
    min-width: 30px;
}

.progress-footer-minimal {
    font-size: 1.2rem;
    color: #475569;
    font-weight: 600;
    margin: 0;
}




.hero-wave path {
    fill: var(--bg-soft-gray);
}

/* Component 5: Achievements Steam-style Layout */
.achievements-section-wrapper {
    max-width: 1000px;
    margin: 40px auto 20px; /* Reduced bottom margin from 100px to 20px */
    padding: 0 20px;
}

.achievements-group {
    margin-bottom: 40px;
}

.achievements-group-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #64748B;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.achievements-group-title::after {
    content: '';
    flex-grow: 1;
    height: 1px;
    background: #E2E8F0;
}

.achievements-scroll-container {
    max-height: 500px; /* Limit height */
    overflow-y: auto;
    padding-right: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Custom Scrollbar for a professional look */
.achievements-scroll-container::-webkit-scrollbar {
    width: 6px;
}

.achievements-scroll-container::-webkit-scrollbar-track {
    background: #F1F5F9;
    border-radius: 10px;
}

.achievements-scroll-container::-webkit-scrollbar-thumb {
    background: #CBD5E1;
    border-radius: 10px;
}

.achievements-scroll-container::-webkit-scrollbar-thumb:hover {
    background: var(--highlight-cyan);
}

/* Achievement Card refinements for vertical list */
.achievement-card {
    background: var(--dark-navy);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    border-radius: 4px; /* Slight roundness for Steam feel */
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-shadow: none;
}

.achievement-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 180, 216, 0.2); /* --highlight-cyan at 20% opacity */
    background: #1e293b;
}

.achievement-icon-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 4px; /* Square with slight roundness */
    background: #334155;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #64748B;
}

.achievement-info {
    flex-grow: 1;
}

.achievement-title {
    color: #FFF;
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 2px;
}

.achievement-subtitle {
    color: #CBD5E1 !important;
    font-size: 0.85rem;
    font-weight: 500;
}

.achievement-status {
    text-align: right;
    display: flex;
    align-items: center;
    gap: 15px;
}

.achievement-progress-text {
    color: #CBD5E1 !important;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Loading state */
.achievements-loading {
    color: #64748B;
    padding: 20px;
    text-align: center;
    font-style: italic;
}

/* Inline spinner for loading states */
.ldg-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #E2E8F0;
    border-top-color: var(--highlight-cyan);
    border-radius: 50%;
    animation: ldg-spin 0.75s linear infinite;
    vertical-align: middle;
}

@keyframes ldg-spin {
    to { transform: rotate(360deg); }
}

/* Hero player name — white like the surrounding title text */
.hero-title .hero-player-name {
    color: #FFF;
}

/* Locked achievement cards — muted */
.achievement-locked .achievement-title {
    color: #94A3B8;
}

.achievement-locked .achievement-subtitle {
    color: #94A3B8 !important;
    font-weight: 500;
}

.achievement-locked .achievement-icon-placeholder {
    background: #334155;
    color: #64748B;
}

.achievement-locked .achievement-progress-text {
    color: #94A3B8 !important;
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

/* Completed achievement cards — green left border, bright */
.achievement-unlocked {
    border-left: 4px solid var(--success-green);
}

.achievement-unlocked .achievement-title {
    color: #FFFFFF;
}

.achievement-unlocked .achievement-subtitle {
    color: #CBD5E1 !important;
    font-weight: 500;
}

.achievement-unlocked .achievement-icon-placeholder {
    background: #1a3a2a;
    color: var(--success-green);
}

/* Green tick for completed cards */
.achievement-tick {
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--success-green);
    flex-shrink: 0;
}

/* Unlocked badge pill */
.achievement-unlocked-badge {
    display: inline-block;
    background: var(--success-green);
    color: #fff;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1px;
    padding: 2px 7px;
    border-radius: 20px;
    text-transform: uppercase;
    margin-left: 6px;
    vertical-align: middle;
}

/* Pop-in entry animation for achievement cards */
@keyframes achievementPopIn {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(8px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.achievement-card-animate {
    opacity: 0;
    animation: achievementPopIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Progress bar shimmer sweep */
@keyframes barShimmer {
    0%   { transform: translateX(0); }
    100% { transform: translateX(300%); }
}

.progress-bar-minimal-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: -60%;
    width: 60%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.35),
        transparent
    );
    animation: barShimmer 2s 1.2s ease-in-out infinite;
}

/* Respect user reduced-motion preference — prevent invisible cards */
@media (prefers-reduced-motion: reduce) {
    .achievement-card-animate {
        animation: none;
        opacity: 1;
    }
}
