@import url('avatar-frames-styles.css');

.courses-section,
.badges-section {
    padding: 20px;
    margin-top: 30px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.courses-header,
.badges-header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.courses-header .section-title,
.badges-header .section-title {
    font-size: 32px;
    font-weight: 700;
    font-family: 'Space Grotesk', sans-serif;
    margin: 0;
    text-align: center;
    color: white;
}

.badges-section {
    padding: 25px 20px;
}

.profile-header {
    transition: all 0.5s ease;
    background-size: cover !important;
    background-position: center !important;
    border: 1px solid var(--glass-border);
}

.profile-header.theme-cyberpunk {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
    border: 1px solid #00f3ff;
    box-shadow: 0 0 20px rgba(0, 243, 255, 0.2), inset 0 0 50px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

.profile-header.theme-cyberpunk::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image:
            linear-gradient(rgba(0, 243, 255, 0.1) 1px, transparent 1px),
            linear-gradient(90deg, rgba(0, 243, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    z-index: 0;
    pointer-events: none;
}

.profile-header.theme-cyberpunk h1 {
    color: #00f3ff;
    text-shadow: 0 0 10px rgba(0, 243, 255, 0.8);
    font-family: 'Courier New', monospace;
    letter-spacing: 2px;
}

.profile-header.theme-cyberpunk .profile-email {
    color: #ff00ff;
}

.profile-header.theme-nature {
    background: linear-gradient(to right bottom, #134e5e, #71b280);
    border: 1px solid #a8e063;
    box-shadow: 0 10px 30px rgba(19, 78, 94, 0.4);
}

.profile-header.theme-nature h1 {
    color: #f0fff4;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.profile-header.theme-nature .user-title-badge {
    background: rgba(168, 224, 99, 0.2);
    border-color: #a8e063;
    color: #d1fae5;
}

.profile-header.theme-royal {
    background: radial-gradient(circle at center, #4b0d0d, #2a0808);
    border: 2px solid #ffd700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.15);
}

.profile-header.theme-royal h1 {
    color: #ffd700;
    font-family: 'Times New Roman', serif;
    font-style: italic;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

.profile-header.theme-royal .profile-email {
    color: #e5e7eb;
    opacity: 0.7;
}

.profile-header.theme-royal .btn-secondary {
    border-color: #ffd700;
    color: #ffd700;
}

.profile-header.theme-royal .btn-secondary:hover {
    background: #ffd700;
    color: #2a0808;
}

.profile-section {
    padding: 60px 0;
    min-height: 70vh;
}

.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    padding: 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
}

.profile-info {
    display: flex;
    gap: 32px;
    align-items: center;
    flex: 1;
}

.profile-avatar-large {
    position: relative;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.level-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    min-width: 44px;
    height: 44px;
    padding: 0 8px;
    border-radius: 22px;
    background: linear-gradient(135deg, #F59E0B, #EAB308);
    border: 3px solid var(--dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 16px;
    font-weight: 700;
    color: white;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.5);
}

.level-icon {
    flex-shrink: 0;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.3));
}

.level-number {
    line-height: 1;
    margin-top: 1px;
}

.profile-details {
    flex: 1;
}

.profile-details h1 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 36px;
    margin-bottom: 8px;
}

.profile-email {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 20px;
}

.level-progress-container {
    margin-bottom: 16px;
    max-width: 600px;
}

.level-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
}

.level-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 16px;
}

.level-xp {
    color: var(--text-muted);
    font-size: 13px;
}

.level-bar-row {
    display: flex;
    align-items: flex-end;
    gap: 16px;
}

.level-content-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.level-progress-bar {
    width: 100%;
    height: 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.level-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366F1, #8B5CF6, #A855F7);
    border-radius: 6px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.5);
}

.profile-stats-inline {
    display: flex;
    gap: 32px;
    font-size: 15px;
    margin-top: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stat-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: var(--primary);
    transition: all 0.3s ease;
}

.stat-item:hover .stat-icon {
    stroke: var(--secondary);
    transform: scale(1.1);
}

.profile-stats-inline span {
    color: var(--text-muted);
}

.profile-stats-inline strong {
    color: var(--text);
    font-size: 17px;
}

.badges-section {
    padding: 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    margin-bottom: 40px;
}

.badges-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    margin-bottom: 24px;
    text-align: center;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 20px;
    justify-items: center;
}

.badge-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    transition: all 0.3s;
    cursor: pointer;
}

.badge-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
}

.badge-icon {
    width: 80px;
    height: 80px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
}

.badge-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-align: center;
}

.courses-filter {
    margin-bottom: 40px;
}

.filter-tabs {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.filter-tab {
    padding: 12px 24px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
}

.filter-tab:hover {
    background: rgba(255, 255, 255, 0.08);
}

.filter-tab.active {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    border-color: transparent;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.course-progress-card {
    padding: 28px;
    border-radius: 20px;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.course-progress-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.course-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.course-icon-small {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.course-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
}

.course-badge.in_progress {
    background: rgba(99, 102, 241, 0.2);
    color: #a5b4fc;
}

.course-badge.completed {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.course-name {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    font-family: 'Space Grotesk', sans-serif;
}

.course-progress-text {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-bar-fill.completed {
    background: linear-gradient(90deg, #22c55e, #16a34a);
}

.course-meta-small {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.progress-percent {
    font-weight: 600;
    color: var(--primary);
}

.btn-continue {
    width: 100%;
    margin-top: 8px;
}

.course-actions-stack {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: auto;
}

.btn-disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid var(--glass-border) !important;
    color: var(--text-muted) !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
    opacity: 0.6;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--text);
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 64px;
    margin-bottom: 24px;
}

.empty-state h3 {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 28px;
    margin-bottom: 12px;
}

.empty-state p {
    color: var(--text-muted);
    font-size: 16px;
    margin-bottom: 32px;
}

.xp-info-link {
    flex-shrink: 0;
    white-space: nowrap;
    margin-bottom: -2px;

    color: var(--primary);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.xp-info-link:hover {
    opacity: 1;
    text-decoration: underline;
}

@media (max-width: 768px) {
    .profile-section {
        padding: 30px 0;
    }

    .profile-header {
        flex-direction: column;
        gap: 30px;
        text-align: center;
        padding: 30px 20px;
    }

    .profile-info {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        text-align: center;
    }

    .profile-details {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .profile-details h1 {
        font-size: 28px;
    }

    .level-progress-container {
        max-width: 100%;
        width: 100%;
    }

    .profile-stats-inline {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
        width: 100%;
        margin-top: 20px;
        background: rgba(255, 255, 255, 0.03);
        padding: 15px;
        border-radius: 12px;
    }

    .stat-item {
        flex-direction: column;
        text-align: center;
        gap: 8px;
        padding: 5px;
    }

    .stat-icon {
        width: 28px;
        height: 28px;
    }

    .btn-secondary {
        width: 100%;
        padding: 14px;
    }

    .badges-section {
        padding: 25px 20px;
    }

    .badges-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 15px;
    }

    .badge-icon {
        width: 60px;
        height: 60px;
    }

    .filter-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 5px;
        margin-top: 15px;
        scrollbar-width: none;
    }

    .filter-tabs::-webkit-scrollbar {
        display: none;
    }

    .filter-tab {
        white-space: nowrap;
        padding: 10px 20px;
        flex-shrink: 0;
    }

    .courses-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .course-progress-card {
        padding: 20px;
    }

    .section-title {
        font-size: 24px;
        margin: 30px 0;
    }
}

.inventory-section {
    padding: 32px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    margin-bottom: 40px;
}

.inventory-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.inventory-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 24px;
    margin: 0;
}

.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.inventory-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.3s;
}

.inventory-item.equipped {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.btn-equip {
    width: 100%;
    padding: 8px;
    margin-top: 12px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-equip:hover {
    background: var(--primary);
    color: white;
}

.btn-equip.equipped {
    background: var(--primary);
    color: white;
}

.profile-avatar-large {
    position: relative;
}

.profile-avatar-large.frame-gold::before {
    content: '';
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    z-index: -1;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.5);
}

.profile-avatar-large.frame-diamond::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: linear-gradient(135deg, #b9f2ff, #4fc3f7);
    z-index: -1;
    box-shadow: 0 0 30px rgba(79, 195, 247, 0.7);
    animation: sparkle 2s infinite;
}

@keyframes sparkle {
    0%, 100% { filter: brightness(1); }
    50% { filter: brightness(1.3); }
}