/* css/profile-system.css */

/* Modal Overlay */
.profile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 15, 30, 0.85);
    backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.profile-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Modal Content */
.profile-modal-content {
    background: linear-gradient(170deg, #0f1a2e 0%, #0a0f1e 100%);
    border: 1px solid rgba(79, 195, 247, 0.3);
    border-radius: 20px;
    width: 90%;
    max-width: 800px;
    height: 85vh;
    max-height: 900px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5), 
                0 0 30px rgba(79, 195, 247, 0.1);
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.profile-modal-overlay.active .profile-modal-content {
    transform: scale(1);
}

/* Close Button */
.profile-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s ease;
    z-index: 10;
}

.profile-close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transform: rotate(90deg);
}

/* Header Section */
.profile-header-section {
    padding: 40px 40px 20px 40px;
    display: flex;
    align-items: center;
    gap: 25px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(to bottom, rgba(79, 195, 247, 0.05), transparent);
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, #4fc3f7, #29b6f6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: #0f1a2e;
    box-shadow: 0 0 20px rgba(79, 195, 247, 0.3);
    border: 4px solid rgba(255, 255, 255, 0.1);
}

.profile-identity {
    flex: 1;
}

.profile-identity h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: #fff;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.profile-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-gold { background: linear-gradient(135deg, #ffd700, #ffb300); color: #000; }
.badge-silver { background: linear-gradient(135deg, #e0e0e0, #bdbdbd); color: #000; }
.badge-bronze { background: linear-gradient(135deg, #cd7f32, #a1887f); color: #000; }
.badge-new { background: rgba(255, 255, 255, 0.1); color: rgba(255, 255, 255, 0.8); }

/* Level Circle */
.profile-level-circle {
    position: relative;
    width: 90px;
    height: 90px;
}

.profile-level-circle svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.level-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.05);
    stroke-width: 8;
}

.level-progress {
    fill: none;
    stroke: #4fc3f7;
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s ease;
    filter: drop-shadow(0 0 4px rgba(79, 195, 247, 0.5));
}

.level-number {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    line-height: 1;
}

.level-number .label {
    display: block;
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 2px;
}

.level-number .value {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
}

/* XP Section */
.profile-xp-section {
    padding: 20px 40px;
    background: rgba(0, 0, 0, 0.2);
}

.xp-bar-container {
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    position: relative;
    overflow: hidden;
    margin-bottom: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.xp-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4fc3f7, #29b6f6);
    border-radius: 12px;
    transition: width 1s ease;
    position: relative;
}

.xp-bar-fill::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transform: translateX(-100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    100% { transform: translateX(100%); }
}

.xp-text {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.xp-next-milestone {
    text-align: right;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Tabs */
.profile-tabs {
    display: flex;
    padding: 0 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    margin-top: 10px;
}

.profile-tab {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    padding: 15px 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.profile-tab:hover {
    color: #fff;
}

.profile-tab.active {
    color: #4fc3f7;
}

.profile-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #4fc3f7;
    box-shadow: 0 -2px 10px rgba(79, 195, 247, 0.5);
}

/* Body Content */
.profile-body {
    flex: 1;
    overflow-y: auto;
    padding: 30px 40px;
    /* Custom Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.profile-body::-webkit-scrollbar {
    width: 6px;
}

.profile-body::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.profile-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.profile-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

.stat-box {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    transition: transform 0.2s;
}

.stat-box:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(79, 195, 247, 0.3);
}

.stat-box i {
    font-size: 1.8rem;
    color: #4fc3f7;
    margin-bottom: 10px;
    opacity: 0.8;
}

.stat-val {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Achievements List */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.achievement-card {
    display: flex;
    align-items: center;
    gap: 15px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.01));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 15px;
    transition: all 0.2s;
}

.achievement-card.unlocked {
    border-color: rgba(255, 215, 0, 0.3); /* Gold border */
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.05), rgba(0, 0, 0, 0.2));
}

.ach-icon {
    width: 50px;
    height: 50px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.ach-info {
    flex: 1;
}

.ach-name {
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

.ach-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
}

/* Inventory Grid */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 15px;
}

.inventory-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.inventory-item:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: scale(1.05);
}

.inv-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.inv-name {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 40px;
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
    grid-column: 1 / -1;
}

/* Loading */
.loading-spinner {
    text-align: center;
    padding: 40px;
    color: #4fc3f7;
    font-size: 1.2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-modal-content {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-height: none;
    }

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

    .profile-xp-section {
        padding: 15px 20px;
    }
    
    .profile-tabs {
        padding: 0 20px;
    }

    .profile-body {
        padding: 20px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
