/* Profile Setup Modal */
.profile-setup-overlay {
    --primary-color: #4f46e5;
    --primary-hover: #4338ca;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --bg-primary: #1f2937;
    --bg-secondary: #111827;
    --border-color: #374151;
    --hover-bg: #1f2937;
    --transition-speed: 0.2s;
    --border-radius: 12px;
    --box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    animation: fadeIn 0.2s ease-out forwards;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    backdrop-filter: blur(5px);
}

.profile-setup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.profile-setup-modal {
    background: var(--bg-primary);
    border-radius: 12px;
    width: 100%;
    max-width: 300px;
    margin: 1rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.3s ease-out forwards;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    box-sizing: border-box;
}

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

/* Header */
.profile-setup-header {
    padding: 0 0 0.5rem;
    text-align: center;
    position: relative;
}

.profile-setup-header .brand-badge {
    width: 2.5rem;
    height: 2.5rem;
    background: var(--primary-color);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-size: 1.1rem;
}

.profile-setup-header .brand-badge {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Username Preview */
.username-preview {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.8rem;
    padding: 0.6rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.username-preview .google-pic {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.username-preview-content {
    min-width: 0;
    overflow: hidden;
}

.username-preview-text {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    width: 100%;
}

/* Username Input */
.form-group {
    position: relative;
    margin-bottom: 0.8rem;
}

#username {
    width: 100%;
    max-width: 100%;
    padding: 0.5rem 0.75rem;
    padding-right: 2rem;
    /* Space for validation icon */
    font-size: 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.2s ease;
    box-sizing: border-box;
    margin: 0 auto;
    display: block;
}

#username:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

/* Username validation status */
.username-status {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.username-status.valid {
    color: #10b981;
    /* Green for valid */
}

.username-status.invalid {
    color: #ef4444;
    /* Red for invalid */
}

/* Form Group */
.form-group {
    margin-bottom: 0.8rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

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

.username-error i {
    font-size: 1rem;
    flex-shrink: 0;
}

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

.username-success i {
    font-size: 1rem;
    flex-shrink: 0;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Helper Text */
.helper {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.3rem;
    margin-bottom: 0;
}

.profile-setup-header h2 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin: 0.2rem 0;
    font-weight: 600;
}

.profile-setup-header .subtitle {
    color: var(--text-secondary);
    margin: 0.5rem 0 0;
    font-size: 1rem;
}

/* Body */
.profile-setup-body {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 1.5rem;
    margin-bottom: 0.8rem;
}

.profile-setup-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
}

/* Avatar Card */
.avatar-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.avatar-frame {
    position: relative;
    width: 150px;
    height: 150px;
    margin-bottom: 0.8rem;
}

#profileSetupAvatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--border-color);
    transition: all var(--transition-speed) ease;
}

.avatar-upload {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    cursor: pointer;
    border: 2px solid var(--bg-secondary);
    transition: all var(--transition-speed) ease;
}

.avatar-upload:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

.avatar-upload i {
    font-size: 1rem;
}

.helper {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin: 0.5rem 0 0;
    line-height: 1.4;
}

/* Form Elements */
.form-group {
    margin-bottom: 0.8rem;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.3rem;
    font-weight: 500;
    font-size: 0.9375rem;
}

.form-control {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 1rem;
    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);
}

textarea.form-control {
    min-height: 120px;
    resize: vertical;
}

/* Interests Grid */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
    margin-top: 0.3rem;
}

.interest-tag {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.interest-tag:hover,
.interest-tag.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
}

/* Actions */
.profile-setup-actions {
    padding: 1.5rem 0 0.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.btn-primary {
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 120px;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.btn-primary:disabled {
    background: #cccccc;
    color: #666666;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-text {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: none;
}

.btn-primary.loading .btn-text {
    visibility: hidden;
}

.btn-primary.loading .btn-loader {
    display: block;
    color: white;
}

/* Ensure the spinner is visible */
.fa-spinner {
    color: white;
}

/* Responsive */
@media (max-width: 768px) {
    .profile-setup-body {
        grid-template-columns: 1fr;
    }

    .avatar-card {
        max-width: 200px;
        margin: 0 auto 1.5rem;
    }

    .interests-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

/* Hide file input */
#avatarUpload {
    display: none;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.profile-setup-modal {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    width: 92%;
    max-width: 900px;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
    position: relative;
    transform: translateY(20px);
    animation: slideUp 0.25s ease-out forwards;
    max-height: 90vh;
    overflow-y: auto;
}

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

.profile-setup-close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.15rem;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.profile-setup-close: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);
}

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

.profile-setup-header {
    text-align: left;
    margin-bottom: 0.8rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.profile-setup-header .brand-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4f46e5, #7c3aed);
    color: white;
    margin-bottom: 0.8rem;
    border: none;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

.profile-setup-header h2 {
    margin: 0 0 0.4rem 0;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.8rem;
    letter-spacing: -0.01em;
    background: linear-gradient(to right, #e2e8f0, #a0aec0);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.profile-setup-header .subtitle {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 400;
    font-size: 0.95rem;
    line-height: 1.5;
}

.profile-setup-body {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.profile-setup-card {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.2s ease;
    height: 100%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.profile-setup-card:hover {
    border-color: #2d3748;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.avatar-card {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.avatar-frame {
    position: relative;
    display: inline-block;
    margin-bottom: 0.8rem;
}

.avatar-frame img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    border: 3px solid var(--border-color);
    object-fit: cover;
    transition: all 0.3s ease;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.avatar-upload {
    position: absolute;
    bottom: 8px;
    right: 8px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #2d3748;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: 2px solid var(--primary-bg);
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.avatar-upload:hover {
    background: #3b82f6;
    transform: scale(1.1);
}

#avatarUpload {
    display: none;
}

.profile-setup-card label {
    display: block;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 600;
    margin: 1.2rem 0 0.6rem 0;
    letter-spacing: 0.3px;
}

.profile-setup-card .helper {
    color: #94a3b8;
    font-size: 0.82rem;
    margin: 0.4rem 0 1rem 0;
    line-height: 1.5;
}

.profile-setup-card input,
.profile-setup-card textarea {
    width: 100%;
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    border-radius: 10px;
    padding: 0.85rem 1.1rem;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.2s ease;
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.profile-setup-card input:focus,
.profile-setup-card textarea:focus {
    border-color: #4f46e5;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

.profile-setup-card textarea {
    min-height: 100px;
    resize: vertical;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
    margin: 0.5rem 0 1rem 0;
}

.choice {
    background: var(--primary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 1rem 1.1rem;
    border-radius: 12px;
    cursor: pointer;
    text-align: left;
    display: flex;
    gap: 0.6rem;
    align-items: center;
    transition: all 0.2s ease;
    font-size: 0.92rem;
    font-weight: 500;
}

.choice i {
    font-size: 1.1rem;
    opacity: 0.9;
    width: 20px;
    text-align: center;
}

.choice:hover {
    transform: translateY(-2px);
    background: var(--hover-color);
    border-color: #3b82f6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.choice.active {
    background: rgba(79, 70, 229, 0.1);
    border-color: #4f46e5;
    color: #818cf8;
}

.choice.active i {
    color: #818cf8;
}

.profile-setup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.8rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-primary {
    background: #10b981;
    color: white;
    border: none;
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 140px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-primary:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 0.85rem 1.5rem;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    min-width: 120px;
    text-align: center;
}

.btn-secondary:hover {
    background: var(--hover-color);
    border-color: #4b5563;
    color: var(--text-primary);
}

/* Responsive Design */
@media (max-width: 900px) {
    .profile-setup-modal {
        width: 95%;
        padding: 1.5rem;
    }

    .profile-setup-body {
        grid-template-columns: 1fr;
        gap: 1.2rem;
    }

    .avatar-card {
        padding: 1.2rem;
    }

    .profile-setup-actions {
        flex-direction: column;
        gap: 0.8rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .profile-setup-card {
        background: #1a1d21;
    }

    .profile-setup-card input,
    .profile-setup-card textarea {
        background: #1e2227;
    }

    .choice {
        background: #1e2227;
    }

    .choice:hover {
        background: #252a30;
    }
}
/* 
New Profile Setup Fields */
.profile-picture-preview {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-pic-large {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.form-group label {
    display: block;
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.bio-textarea {
    resize: vertical;
    min-height: 80px;
    font-family: inherit;
}

.banner-color-picker {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.color-input {
    width: 60px;
    height: 40px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    background: transparent;
}

.banner-preview {
    flex: 1;
    height: 60px;
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

/* Adjust modal width for new content */
.profile-setup-modal {
    max-width: 500px;
}

.profile-setup-body {
    overflow-y: auto;
    max-height: calc(100vh - 250px);
    padding-right: 0.5rem;
}

/* Scrollbar styling */
.profile-setup-body::-webkit-scrollbar {
    width: 6px;
}

.profile-setup-body::-webkit-scrollbar-track {
    background: var(--bg-secondary);
    border-radius: 3px;
}

.profile-setup-body::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.profile-setup-body::-webkit-scrollbar-thumb:hover {
    background: #4b5563;
}
