/* Meetgle Profile Modal Styles */

.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: 40px 20px;
}

.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;
}

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

.meetgle-profile-loading p {
    color: #6b7280;
    font-size: 14px;
}

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

/* Profile Content */
.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 */
.profile-interests {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.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 */
.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 Responsive */
@media (max-width: 600px) {
    .meetgle-modal-content {
        width: 95%;
        max-width: none;
        margin: 20px;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* iOS-specific fixes for Profile Modal */
@supports (-webkit-touch-callout: none) {
    .meetgle-modal-content {
        max-height: 85vh !important;
        margin: 20px auto !important;
    }
}

/* Additional mobile safety */
@media (max-width: 768px) {
    .meetgle-modal {
        padding: 10px !important;
    }
    
    .meetgle-modal-content {
        max-height: 88vh !important;
        margin: auto !important;
    }
}

/* Photo Skeleton Loading Placeholders */
.profile-photo-card.photo-skeleton {
    background: #f3f4f6;
    cursor: default;
}

.profile-photo-card.photo-skeleton:hover {
    transform: none;
    box-shadow: none;
}

.photo-skeleton-shimmer {
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        #f3f4f6 0%,
        #e5e7eb 20%,
        #f3f4f6 40%,
        #f3f4f6 100%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 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 .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;
}
