/**
 * FlingNow - Profile Detail Modal
 * Shared modal for viewing full user profiles
 */

/* ========================================
   MODAL OVERLAY
   ======================================== */

.profile-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-6);
    animation: fadeIn var(--duration-base) var(--ease-out) both;
}

.profile-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.95);
}

/* ========================================
   MODAL CONTENT
   ======================================== */

.profile-modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-base);
    border: var(--space-px) solid var(--border-invisible);
    border-radius: 16px;
    animation: profileModalEnter var(--duration-slow) var(--ease-out) both;
}

@keyframes profileModalEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Hide scrollbar but keep functionality */
.profile-modal-content::-webkit-scrollbar {
    width: 0;
}

/* ========================================
   CLOSE BUTTON
   ======================================== */

.profile-modal-close {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    z-index: 10;
    width: 32px;
    height: 32px;
    min-width: 32px;
    min-height: 32px;
    padding: 0;
    gap: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(8px);
    border: var(--space-px) solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 0;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
}

.profile-modal-close svg {
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2.5;
    flex-shrink: 0;
}

.profile-modal-close:hover {
    background: rgba(10, 10, 10, 0.85);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    transform: scale(1.05);
}

.profile-modal-close:active {
    transform: scale(0.95);
}

/* ========================================
   PHOTO GALLERY
   ======================================== */

.profile-modal-gallery {
    position: relative;
    width: 100%;
    height: 320px;
    background: var(--bg-raised);
    overflow: hidden;
    border-radius: 16px 16px 0 0;
    flex-shrink: 0;
}

.profile-modal-photo {
    width: 100%;
    height: 100%;
    position: relative;
}

.profile-modal-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity var(--duration-base) var(--ease-out);
}

/* Placeholder when no photo */
.profile-modal-photo-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-serif);
    font-size: 80px;
    font-weight: var(--weight-light);
    font-style: italic;
    color: var(--text-whisper);
}

/* Gradient overlay on photo */
.profile-modal-photo::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(to top, var(--bg-base), transparent);
    pointer-events: none;
}

/* Thumbnail dots navigation */
.profile-modal-thumbs {
    position: absolute;
    top: var(--space-4);
    left: var(--space-4);
    right: var(--space-4);
    display: flex;
    gap: var(--space-1);
    z-index: 5;
}

.profile-modal-thumb-dot {
    flex: 1;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: background var(--duration-base) var(--ease-out);
}

.profile-modal-thumb-dot.active {
    background: rgba(255, 255, 255, 0.9);
}

.profile-modal-thumb-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

/* Photo navigation areas (left/right click zones) */
.profile-modal-photo-nav {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40%;
    z-index: 4;
    cursor: pointer;
}

.profile-modal-photo-nav.prev {
    left: 0;
}

.profile-modal-photo-nav.next {
    right: 0;
}

/* ========================================
   PROFILE INFO
   ======================================== */

.profile-modal-info {
    padding: var(--space-6) var(--space-6) var(--space-8);
}

.profile-modal-header {
    display: flex;
    align-items: baseline;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
}

.profile-modal-name {
    font-family: var(--font-serif);
    font-size: var(--text-2xl);
    font-weight: var(--weight-light);
    color: var(--text-primary);
    margin: 0;
}

.profile-modal-age {
    font-size: var(--text-lg);
    font-weight: var(--weight-light);
    color: var(--text-secondary);
}

.profile-modal-gender {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    text-transform: uppercase;
    color: var(--text-tertiary);
    margin-bottom: var(--space-6);
}

/* Bio section */
.profile-modal-bio {
    margin-bottom: var(--space-6);
    padding-bottom: var(--space-6);
    border-bottom: var(--space-px) solid var(--border-invisible);
}

.profile-modal-bio:empty {
    display: none;
}

.profile-modal-bio p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Interests section */
.profile-modal-interests {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
}

.profile-modal-interests:empty {
    display: none;
}

.profile-modal-interest-tag {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    letter-spacing: var(--tracking-wide);
    color: var(--text-secondary);
    padding: var(--space-2) var(--space-3);
    border: var(--space-px) solid var(--border-subtle);
}

/* ========================================
   ACTION FOOTER (for superlikes)
   ======================================== */

.profile-modal-actions {
    display: none;
    justify-content: center;
    gap: var(--space-5);
    padding: var(--space-6);
    border-top: var(--space-px) solid var(--border-invisible);
}

.profile-modal-actions.visible {
    display: flex;
}

.profile-modal-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border-radius: 50%;
    border: var(--space-px) solid var(--border-subtle);
    background: var(--bg-base);
    color: var(--text-tertiary);
    cursor: pointer;
    transition: all var(--duration-base) var(--ease-out);
}

.profile-modal-action-btn svg {
    width: 22px;
    height: 22px;
}

.profile-modal-action-btn.like:hover {
    border-color: #a85454;
    color: #a85454;
    background: rgba(168, 84, 84, 0.08);
    transform: scale(1.1);
}

.profile-modal-action-btn.dislike:hover {
    border-color: var(--text-tertiary);
    color: var(--text-primary);
    transform: scale(1.1);
}

/* ========================================
   UTILITY
   ======================================== */

.profile-modal.hidden {
    display: none !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 480px) {
    .profile-modal {
        padding: 0;
    }

    .profile-modal-content {
        max-width: 100%;
        max-height: 100vh;
        border: none;
        border-radius: 0;
    }

    .profile-modal-gallery {
        border-radius: 0;
    }
}
