/* Meetgle Profile Modal Styles */

/* Hide scrollbar on profile modal while keeping it scrollable */
.profile-modal-content {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
.profile-modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Hide scrollbar on edit profile modal while keeping it scrollable */
.edit-profile-modal-content {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
.edit-profile-modal-content::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.meetgle-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.meetgle-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.meetgle-modal-content {
    background: white;
    border-radius: 16px;
    padding: 0;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
    margin: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.meetgle-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 20px;
    line-height: 0;
    cursor: pointer;
    color: white;
    transition: all 0.2s;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-weight: 300;
}

.meetgle-modal-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.meetgle-modal-close:active {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(0.95);
}

.meetgle-profile-modal-body {
    padding: 0;
}

/* Loading State */
.meetgle-profile-loading {
    text-align: center;
    padding: 48px 20px;
}

/* Dark loading text for profile modal */
.profile-modal-content .meetgle-profile-loading p {
    color: rgba(255,255,255,0.35);
    font-size: 13px;
    margin: 0;
}

/* Dark loading text for edit profile modal */
.edit-profile-modal-content .meetgle-profile-loading p {
    color: rgba(255,255,255,0.4);
    font-size: 14px;
}

/* Light loading text fallback */
.meetgle-profile-loading p {
    color: #6b7280;
    font-size: 14px;
}

/* Spinner for edit profile / send sparks (light theme) */
.profile-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top-color: var(--theme-button-primary, #8b5cf6);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

/* Edit profile avatar upload */
.edit-avatar-wrap {
    position: relative;
    flex-shrink: 0;
    cursor: pointer;
    display: block;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}
.edit-avatar-img {
    width: 90px !important;
    height: 90px !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    display: block !important;
    border: 3px solid rgba(255,255,255,0.15) !important;
    box-shadow: 0 8px 24px rgba(0,0,0,0.3) !important;
    transition: opacity 0.2s;
}
.edit-avatar-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s;
    border-radius: 50%;
}
.edit-avatar-wrap:hover .edit-avatar-overlay,
.edit-avatar-wrap:active .edit-avatar-overlay {
    opacity: 1;
}
/* Always show overlay on touch devices */
@media (hover: none) {
    .edit-avatar-overlay {
        opacity: 1;
        background: rgba(0,0,0,0.3);
    }
}

/* Dark glass input styling for edit profile */
.edit-profile-modal-content input,
.edit-profile-modal-content select,
.edit-profile-modal-content textarea {
    box-sizing: border-box;
}

.edit-profile-modal-content input:focus,
.edit-profile-modal-content select:focus,
.edit-profile-modal-content textarea:focus {
    outline: none;
    border-color: rgba(255,255,255,0.2) !important;
}

.edit-profile-modal-content input::placeholder,
.edit-profile-modal-content textarea::placeholder {
    color: rgba(255,255,255,0.3);
}

/* Dark select option styling */
.edit-profile-modal-content select option {
    background: #1a1a2e;
    color: white;
}

/* Dark error for edit profile modal */
.edit-profile-modal-content .meetgle-profile-error {
    color: #EF4444;
}

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

/* Error State */
.meetgle-profile-error {
    text-align: center;
    padding: 40px 20px;
}

/* Dark error for profile modal */
.profile-modal-content .meetgle-profile-error {
    color: #EF4444;
}

/* (edit profile error styling is above with dark glass rules) */

/* Profile Content - these are used by edit profile modal (keep for backwards compat) */
.profile-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #f3f4f6;
}

.profile-header-info {
    flex: 1;
}

.profile-header-info h2 {
    margin: 0 0 8px 0;
    font-size: 24px;
    color: #111827;
}

/* Profile Badges */
.profile-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    vertical-align: middle;
}

.profile-badge.verified {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(10px);
}

.profile-badge.premium {
    background: rgba(251, 191, 36, 0.4);
    color: white;
    border: 2px solid rgba(251, 191, 36, 0.6);
    backdrop-filter: blur(10px);
}

.profile-badge.gender {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.35);
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.profile-badge.external {
    background: rgba(251, 191, 36, 0.4);
    color: white;
    border: 2px solid rgba(251, 191, 36, 0.6);
    backdrop-filter: blur(10px);
}

/* Profile Sections */
.profile-section {
    margin-bottom: 16px;
}

.profile-section:last-child {
    margin-bottom: 0;
}

.profile-section h3 {
    margin: 0 0 12px 0;
    font-size: 16px;
    color: #111827;
    font-weight: 600;
}

.profile-section p {
    margin: 0;
    color: #4b5563;
    line-height: 1.6;
}

.profile-section p em {
    color: #9ca3af;
    font-style: italic;
}

/* Interests (base - used by edit profile) */
.profile-interests {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Dark glass interest tags for edit profile modal */
.edit-profile-modal-content .profile-interest-tag {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.2s ease;
}

.edit-profile-modal-content .profile-interest-tag:hover {
    transform: none;
    box-shadow: none;
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: #EF4444;
}

/* Light theme interest tags (public profile view) */
.profile-interest-tag {
    padding: 8px 16px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--theme-button-primary, #8b5cf6) 15%, white) 0%,
        color-mix(in srgb, var(--theme-button-primary, #8b5cf6) 25%, white) 100%
    );
    border: 2px solid color-mix(in srgb, var(--theme-button-primary, #8b5cf6) 50%, white);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: color-mix(in srgb, var(--theme-button-primary, #8b5cf6) 85%, black);
    transition: all 0.2s ease;
}

.profile-interest-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--theme-button-primary, #8b5cf6) 20%, transparent);
}

/* Stats Grid (used by old layout, kept for backwards compat) */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.profile-stat {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px;
    background: #f9fafb;
    border-radius: 16px;
    border: 2px solid rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.profile-stat:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.stat-icon {
    font-size: 28px;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.stat-info {
    flex: 1;
    min-width: 0;
}

.stat-value {
    font-size: 24px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 2px;
    line-height: 1;
}

.stat-label {
    font-size: 12px;
    color: #6b7280;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Mobile fullscreen - Send Sparks */
@media (max-width: 900px) {
    #sendSparksModal { padding: 0 !important; }
    #sendSparksModal > .send-sparks-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100svh !important;
        max-height: 100vh !important;
        max-height: 100svh !important;
        border-radius: 0 !important;
    }
}

/* Mobile fullscreen - Edit Profile */
@media (max-width: 900px) {
    #meetgleEditProfileModal { padding: 0 !important; }
    #meetgleEditProfileModal > .edit-profile-modal-content {
        width: 100vw !important;
        max-width: 100vw !important;
        height: 100vh !important;
        height: 100svh !important;
        max-height: 100vh !important;
        max-height: 100svh !important;
        border-radius: 0 !important;
    }
}

/* Photo Viewer Loading State */
.photo-viewer-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 5;
}

.photo-viewer-loading .profile-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(255,255,255,0.2);
    border-top-color: rgba(255,255,255,0.8);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.photo-viewer-loading span {
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    font-weight: 500;
}

/* Hide image while loading in photo viewer */
#photoViewerImage.loading {
    opacity: 0;
}

#photoViewerImage {
    transition: opacity 0.2s ease;
}
