/* Premium Dark Theme - Isolated to Profile Only */
.spu-profile-wrapper {
    /* Full page background */
    max-width: none;
    width: 100%; /* Changed from 100vw to prevent horizontal scrollbar issues */
    min-height: 100vh;
    margin: 0;
    padding: 0; /* Remove padding from wrapper so background is edge-to-edge */
    /* REMOVED: background: linear-gradient(135deg, #0f0f23 0%, #1a1a2e 50%, #16213e 100%); */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    position: relative;
    isolation: isolate;
}

.spu-profile-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #8b5cf6 0%, #3b82f6 50%, #06b6d4 100%);
    z-index: 1;
}

/* New Layout Grid - Content Area */
.spu-profile-form {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    max-width: 1400px; /* Max width for the content */
    /* Centering and spacing for non-edge-to-edge content */
    margin: 0 auto;
    padding: 2rem 5vw; /* Added vertical padding and responsive horizontal padding (5vw) */
    min-height: 100vh; /* Ensure content area visually spans full height */
    align-items: start;
    box-sizing: border-box; /* Include padding in the width calculation */
}

/* Left Sidebar - Redesigned */
.spu-profile-sidebar {
    background: rgba(255, 255, 255, 0.05); /* Lighter, semi-transparent background */
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    padding: 3rem 2rem;
    text-align: center;
    position: sticky;
    top: 2rem;
    height: fit-content;
}

/* Fixed Profile Image */
.spu-profile-avatar {
    position: relative;
    width: 180px;
    height: 180px;
    margin: 0 auto 2rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    padding: 4px;
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.3);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.spu-profile-avatar-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(30, 41, 59, 0.8); /* Semi-transparent background */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.spu-avatar {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.spu-profile-avatar:hover {
    transform: translateY(-5px) scale(1.05);
    box-shadow: 0 25px 50px rgba(139, 92, 246, 0.4);
}

.spu-profile-avatar:hover .spu-avatar {
    transform: scale(1.1);
}

.spu-avatar-overlay {
    position: absolute;
    top: 4px;
    left: 4px;
    right: 4px;
    bottom: 4px;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.9) 0%, rgba(59, 130, 246, 0.9) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.spu-profile-avatar:hover .spu-avatar-overlay {
    opacity: 1;
}

.spu-upload-btn {
    background: rgba(255, 255, 255, 0.95);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #1e293b;
    transform: scale(0.9);
}

.spu-profile-avatar:hover .spu-upload-btn {
    transform: scale(1);
}

.spu-upload-btn:hover {
    background: #ffffff;
    transform: scale(1.1);
    color: #8b5cf6;
}

.spu-user-info {
    margin: 2rem 0 1.5rem 0;
}

.spu-username {
    font-size: 1.4rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.spu-user-email {
    color: #94a3b8;
    font-size: 0.95rem;
    margin: 0;
}

.spu-user-meta {
    margin-top: 1.5rem;
}

.spu-user-meta p {
    color: #94a3b8;
    font-size: 0.9rem;
    margin: 0;
}

/* Main Content Area */
.spu-profile-main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tab Navigation */
.spu-profile-tabs {
    display: flex;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05); /* Lighter, semi-transparent background */
    border-radius: 16px;
    padding: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.spu-tab {
    flex: 1;
    padding: 1rem 1.5rem;
    background: transparent;
    border: none;
    border-radius: 12px;
    color: #94a3b8;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
}

.spu-tab.active {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.spu-tab:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
    color: #e2e8f0;
}

/* Tab Content */
.spu-tab-content {
    display: none;
}

.spu-tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Enhanced Section Styling */
.spu-section {
    background: rgba(255, 255, 255, 0.05); /* Lighter, semi-transparent background */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem;
    backdrop-filter: blur(20px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

.spu-section:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: rgba(139, 92, 246, 0.3);
}

.spu-section-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.spu-section-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
}

.spu-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f1f5f9;
    margin: 0;
}

.spu-section-subtitle {
    color: #94a3b8;
    font-size: 0.95rem;
    margin: 0.25rem 0 0 0;
}

/* Enhanced Form Fields */
.spu-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.spu-field-full {
    grid-column: 1 / -1;
}

.spu-field {
    margin-bottom: 1.5rem;
}

.spu-field:last-child {
    margin-bottom: 0;
}

.spu-field label {
    display: block;
    font-weight: 600;
    color: #e2e8f0;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.spu-field input,
.spu-field textarea,
.spu-field select {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05); /* Lighter, semi-transparent background */
    color: #f1f5f9;
    backdrop-filter: blur(10px);
    box-sizing: border-box;
}

.spu-field input:focus,
.spu-field textarea:focus,
.spu-field select:focus {
    outline: none;
    border-color: #8b5cf6;
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.2);
    transform: translateY(-1px);
}

.spu-field textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* Enhanced Save Button */
.spu-action-bar {
    background: rgba(255, 255, 255, 0.05); /* Lighter, semi-transparent background */
    border-radius: 16px;
    padding: 1.5rem 2rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1rem;
}

.spu-save-btn {
    background: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 50%, #06b6d4 100%);
    color: white;
    border: none;
    padding: 1.25rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 25px rgba(139, 92, 246, 0.4);
    position: relative;
    overflow: hidden;
    min-width: 180px;
}

.spu-save-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.spu-save-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(139, 92, 246, 0.5);
}

.spu-save-btn:hover::before {
    left: 100%;
}

.spu-save-btn:active {
    transform: translateY(-1px);
}

/* Success Notification */
#spu-profile-updated[data-status="success"] {
    position: fixed;
    top: 30px;
    right: 30px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 1.25rem 2rem;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(16, 185, 129, 0.4);
    z-index: 10000;
    animation: slideInRight 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#spu-profile-updated[data-status="success"]::before {
    content: '✓ Profile updated successfully!';
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .spu-profile-form {
        grid-template-columns: 1fr;
        max-width: 800px; /* Adjust max-width on tablets */
        padding: 2rem 4vw; /* Slightly less responsive padding */
        min-height: auto; /* Allow content to dictate height on smaller screens */
    }
    
    .spu-profile-sidebar {
        position: static;
        max-width: none;
        margin: 0;
    }
}

@media (max-width: 768px) {
    .spu-profile-wrapper {
        padding: 0;
    }
    
    .spu-profile-form {
        padding: 1.5rem; /* Fixed padding on small screens */
        gap: 1.5rem;
    }
    
    .spu-fields-grid {
        grid-template-columns: 1fr;
    }
    
    .spu-profile-tabs {
        flex-direction: column;
    }
    
    .spu-section {
        padding: 2rem 1.5rem;
    }
    
    .spu-profile-sidebar {
        padding: 2rem 1.5rem;
    }
    
    .spu-profile-avatar {
        width: 150px;
        height: 150px;
    }
    
    .spu-action-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .spu-save-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .spu-profile-form {
        padding: 1rem;
    }
    
    .spu-section {
        padding: 1.5rem 1rem;
    }
    
    .spu-profile-sidebar {
        padding: 1.5rem 1rem;
    }
    
    .spu-profile-avatar {
        width: 120px;
        height: 120px;
    }
}

/* Loading state */
.spu-profile-form.processing {
    opacity: 0.8;
    pointer-events: none;
}

.spu-profile-form.processing .spu-save-btn::after {
    content: '...';
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0%, 33% { content: '.'; }
    34%, 66% { content: '..'; }
    67%, 100% { content: '...'; }
}