/* Profile Settings Modal - Polished Modern Design */
.profile-settings-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    backdrop-filter: blur(12px);
}

.profile-settings-modal {
    background: linear-gradient(145deg, rgba(30, 32, 34, 0.98), rgba(24, 26, 28, 0.98));
    border-radius: 16px;
    width: 100%;
    max-width: 480px;
    margin: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transform: translateY(30px) scale(0.95);
    opacity: 0;
    animation: slideUp 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Header */
.profile-settings-header {
    padding: 2rem 2rem 1.5rem;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent);
}

.profile-settings-header .brand-badge {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3), 0 0 0 1px rgba(76, 175, 80, 0.2) inset;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.profile-settings-header .brand-badge::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: conic-gradient(from 0deg, #4CAF50, #6ee7b7, #4CAF50);
    filter: blur(8px);
    opacity: 0.3;
    animation: spin 3s linear infinite;
}

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

.profile-settings-header .brand-badge:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 12px 32px rgba(76, 175, 80, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.3) inset;
}

.profile-settings-header h2 {
    color: #ffffff;
    font-size: 1.75rem;
    margin: 0 0 0.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.profile-settings-header .subtitle {
    color: rgba(255, 255, 255, 0.6);
    margin: 0;
    font-size: 0.95rem;
    font-weight: 500;
}

/* Close Button - Polished Style */
.close-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 1.15rem;
    line-height: 1;
    padding: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
}

.close-btn:hover {
    background: rgba(255, 71, 87, 0.15);
    border-color: rgba(255, 71, 87, 0.3);
    color: #ff4757;
    transform: scale(1.05) rotate(90deg);
    box-shadow: 0 4px 12px rgba(255, 71, 87, 0.2);
}

.close-btn:active {
    transform: scale(0.95) rotate(90deg);
}

.close-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.3);
}

/* Profile Picture */
.profile-picture-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.5rem;
    position: relative;
}

/* Profile picture styles */
.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(76, 175, 80, 0.4);
    margin-bottom: 1.25rem;
    display: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(76, 175, 80, 0.2) inset;
}

/* Profile picture placeholder */
.profile-pic-placeholder {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: rgba(255, 255, 255, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-pic-placeholder i {
    opacity: 0.5;
}

.profile-pic:hover {
    transform: scale(1.08) rotate(3deg);
    box-shadow: 0 12px 32px rgba(76, 175, 80, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.3) inset;
    border-color: rgba(76, 175, 80, 0.6);
}

/* Profile picture upload button */
#changeProfilePicBtn {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.8);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    padding: 0.65rem 1.25rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

#changeProfilePicBtn:hover {
    background: rgba(76, 175, 80, 0.12);
    border-color: rgba(76, 175, 80, 0.3);
    color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.2);
}

#changeProfilePicBtn:active {
    transform: translateY(0);
}

#changeProfilePicBtn i {
    font-size: 1rem;
    transition: transform 0.3s ease;
}

#changeProfilePicBtn:hover i {
    transform: scale(1.1);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

/* Add this for the username input container */
.username-edit-container {
    position: relative;
    width: 100%;
}

/* Username input container */
.username-input-container {
    position: relative;
    width: 100%;
}

/* Username edit container */
.username-edit-container {
    position: relative;
    width: 100%;
}

/* Username input field */
#editUsername {
    width: 100%;
    padding: 0.85rem 2.5rem 0.85rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    backdrop-filter: blur(8px);
}

#editUsername:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.12);
}

#editUsername:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(76, 175, 80, 0.4);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.15), 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Clear button for input */
.clear-input {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1.25rem;
    height: 1.25rem;
    display: none;
    align-items: center;
    justify-content: center;
    background: var(--text-secondary);
    color: var(--bg-secondary);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    padding: 0;
    font-size: 0.75rem;
    pointer-events: auto;
    z-index: 2;
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.clear-input:hover,
.clear-input:focus {
    opacity: 1;
    background: var(--text-primary);
    outline: none;
}

/* Make sure the clear button doesn't affect input text */
.username-edit-container {
    position: relative;
}

.username-edit-container input[type="text"] {
    padding-right: 2.5rem !important;
}

/* Style the helper text */
.helper {
    display: block;
    margin-top: 0.65rem;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.5);
    line-height: 1.5;
    font-weight: 500;
}

.form-group label {
    display: block;
    color: #ffffff;
    margin-bottom: 0.65rem;
    font-weight: 600;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
}

.form-control {
    width: 100%;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-speed) ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Username Status */
.username-status {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    pointer-events: none;
    background: var(--bg-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%) translateX(10px);
}

.username-input-container:focus-within .username-status,
.username-input-container:hover .username-status {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0);
}

.username-status.valid {
    color: #38a169; /* Green for valid */
    opacity: 1;
    visibility: visible;
}

.username-status.invalid {
    color: #e53e3e; /* Red for invalid */
    opacity: 1;
    visibility: visible;
}

.username-status i {
    font-size: 0.875rem;
}

/* Add this to your existing input container */
.username-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

/* Buttons - Polished Modern Style */
.profile-settings-actions {
    display: flex;
    gap: 0.75rem;
    padding: 1.5rem 2rem 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: linear-gradient(180deg, transparent, rgba(255, 255, 255, 0.01));
}

.btn-primary, .btn-secondary {
    padding: 0.85rem 1.75rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    letter-spacing: 0.02em;
}

.btn-primary {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
    flex: 1;
    border: none;
    box-shadow: 0 8px 24px rgba(76, 175, 80, 0.3), 0 0 0 1px rgba(76, 175, 80, 0.2) inset;
    overflow: hidden;
}

.btn-primary::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 ease;
}

.btn-primary:hover:not(:disabled)::before {
    left: 100%;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #45a049, #3d8b40);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(76, 175, 80, 0.4), 0 0 0 1px rgba(76, 175, 80, 0.3) inset;
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.3);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.1);
    box-shadow: none;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.18);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-secondary:active {
    transform: translateY(0);
}

/* Error and Success Messages */
.settings-error {
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 10px;
    color: #ef4444;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideDown 0.3s ease-out;
}

.settings-error i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.settings-success {
    margin-top: 0.75rem;
    padding: 0.875rem 1rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    color: #10b981;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideDown 0.3s ease-out;
}

.settings-success i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

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

/* Helper Text */
.helper {
    color: var(--text-secondary);
    font-size: 0.8125rem;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

/* Animations */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes slideUp {
    to { 
        transform: translateY(0) scale(1); 
        opacity: 1; 
    }
}

/* Profile Settings Body */
.profile-settings-body {
    padding: 1.5rem 2rem;
    overflow-y: auto;
    flex: 1;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .profile-settings-modal {
        margin: 0.5rem;
        padding: 1rem;
        max-height: calc(100vh - 1rem);
    }
    
    .profile-settings-actions {
        flex-direction: column;
    }
    
    .btn-primary, .btn-secondary {
        width: 100%;
    }
}
