/* Profile UI Styles */
.map-profile-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-right: 8px;
    transition: all 0.3s ease;
}

.map-profile-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.profile-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20000;
}

.profile-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
}

.profile-modal .modal-content {
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    z-index: 10001;
}

.profile-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.profile-modal .modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.profile-modal .modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.profile-modal .modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.profile-tabs {
    display: flex;
    background: #4a5568;
    border-bottom: 1px solid #718096;
}

.profile-tabs .tab-btn {
    flex: 1;
    background: none;
    border: none;
    color: #a0aec0;
    padding: 15px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.profile-tabs .tab-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.profile-tabs .tab-btn.active {
    color: white;
    background: rgba(102, 126, 234, 0.3);
    border-bottom-color: #667eea;
}

.profile-content {
    padding: 20px;
    max-height: 60vh;
    overflow-y: auto;
    color: #e2e8f0;
}

.tab-content {
    display: none;
}

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

/* Profile Overview */
.profile-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.profile-header {
    display: flex;
    gap: 20px;
    align-items: center;
    padding: 20px;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(102, 126, 234, 0.3);
}

.avatar-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    font-size: 3rem;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 2px solid rgba(102, 126, 234, 0.5);
}

.change-avatar-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.3s ease;
}

.change-avatar-btn:hover {
    background: #5a67d8;
}

.user-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.8rem;
    color: white;
}

.user-type {
    color: #a0aec0;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.cosmic-coins {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #2d3748;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 1.1rem;
}

.quick-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
}

.stat-icon {
    font-size: 2rem;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
}

.stat-label {
    font-size: 0.8rem;
    color: #a0aec0;
    margin-top: 2px;
}

/* Inventory Styles */
.inventory-section {
    margin-bottom: 30px;
}

.inventory-section h4 {
    color: white;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.sprite-inventory, .items-inventory, .abilities-inventory {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
}

.inventory-sprite, .ability-item {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    transition: all 0.3s ease;
}

.inventory-sprite:hover, .ability-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.sprite-icon, .ability-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.sprite-name, .ability-name {
    font-size: 0.9rem;
    color: white;
    margin-bottom: 4px;
}

.sprite-price {
    font-size: 0.8rem;
    color: #ffd700;
}

.ability-description {
    font-size: 0.7rem;
    color: #a0aec0;
}

.empty-inventory, .coming-soon {
    text-align: center;
    color: #a0aec0;
    font-style: italic;
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.2);
}

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

.stat-category h4 {
    color: white;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.stat-list {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    overflow: hidden;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.stat-row span:first-child {
    color: #e2e8f0;
}

.stat-row span:last-child {
    color: #667eea;
    font-weight: bold;
}

.class-stat-row {
    display: grid;
    grid-template-columns: 1fr auto auto;
    gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: center;
}

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

.class-name {
    color: white;
    font-weight: bold;
}

.class-level {
    color: #667eea;
    font-size: 0.9rem;
}

.class-playtime {
    color: #a0aec0;
    font-size: 0.8rem;
}

/* Settings Styles */
.settings-sections {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.setting-category h4 {
    color: white;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.3);
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-item label {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #e2e8f0;
    cursor: pointer;
    flex: 1;
}

.setting-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #667eea;
}

.setting-item input[type="range"] {
    width: 120px;
    accent-color: #667eea;
}

.setting-item select {
    background: #4a5568;
    color: white;
    border: 1px solid #718096;
    border-radius: 4px;
    padding: 6px 10px;
}

.volume-display {
    color: #667eea;
    font-weight: bold;
    min-width: 40px;
    text-align: right;
}

.settings-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #718096;
    color: white;
}

.btn-secondary:hover {
    background: #4a5568;
    transform: translateY(-1px);
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .profile-modal .modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .quick-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .profile-tabs {
        flex-wrap: wrap;
    }
    
    .profile-tabs .tab-btn {
        flex: 1 1 50%;
        min-width: 120px;
    }
}

/* Sprite Store Animation for Profile Inventory */
.sprite-animation-container {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    margin-bottom: 6px;
}

.sprite-animation-2x2 {
    width: 96px;
    height: 96px;
    background-size: 192px 192px !important;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    animation: spriteAnimation2x2 1.2s steps(1) infinite;
}

.sprite-emoji {
    font-size: 3rem;
}

@keyframes spriteAnimation2x2 {
    0% { background-position: 0 0; }             /* Frame 1: top-left */
    25% { background-position: -96px 0; }        /* Frame 2: top-right */
    50% { background-position: 0 -96px; }        /* Frame 3: bottom-left */
    75% { background-position: -96px -96px; }    /* Frame 4: bottom-right */
    100% { background-position: 0 0; }           /* Back to frame 1 */
}

/* Updated sprite inventory layout */
.sprite-inventory .inventory-sprite {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px;
}

.sprite-inventory .sprite-name {
    font-size: 0.75rem;
    margin-top: 5px;
    text-align: center;
    line-height: 1.2;
    color: #e2e8f0;
}


/* Profile Avatar Animation */
.profile-avatar-container {
    width: 80px !important;
    height: 80px !important;
    margin: 0 auto;
}

.profile-avatar-container .sprite-animation-2x2 {
    width: 64px !important;
    height: 64px !important;
    background-size: 128px 128px !important;
}

@keyframes profileSpriteAnimation2x2 {
    0% { background-position: 0 0; }
    25% { background-position: -64px 0; }
    50% { background-position: 0 -64px; }
    75% { background-position: -64px -64px; }
    100% { background-position: 0 0; }
}

