/* ==========================================
   USER PORTAL STYLES
   ========================================== */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background-color: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
}

.user-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.portal-layout {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 5%;
    gap: 2rem;
}

.main-content {
    flex: 1;
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.profile-card {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background-color: var(--bg-card);
    aspect-ratio: 3/4;
    border: 1px solid var(--border-color);
}

.profile-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.profile-card:hover img {
    transform: scale(1.05);
}

.profile-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
}

.profile-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

/* Premium Treatments */
.premium-border {
    border: 2px solid var(--premium);
    box-shadow: 0 0 15px rgba(251, 191, 36, 0.2);
}

.premium-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--premium);
    color: #000;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    z-index: 2;
}

.premium-locked img {
    filter: blur(10px);
}

.blur-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    z-index: 2;
    background: rgba(15, 23, 42, 0.4);
}

.lock-icon {
    width: 48px;
    height: 48px;
    color: var(--text-main);
}

/* Upgrade Section & Dropzone */
.upgrade-section {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.tier-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.tier-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    text-align: center;
}

.tier-card.premium {
    border-color: var(--premium);
    transform: scale(1.05);
}

.tier-card .price {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 1rem 0;
}
.tier-card .price span { font-size: 1rem; color: var(--text-muted); }
.tier-card ul { list-style: none; text-align: left; margin-bottom: 1.5rem; }
.tier-card li { margin-bottom: 0.5rem; display: flex; align-items: center; gap: 0.5rem; }
.tier-card li i { color: var(--success); width: 16px; }

.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius-lg);
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background-color: var(--bg-input);
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary);
    background-color: rgba(255, 75, 114, 0.05);
}

.dropzone i { width: 48px; height: 48px; color: var(--text-muted); margin-bottom: 1rem; }
.dropzone span { color: var(--primary); text-decoration: underline; }

.upload-status {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(251, 191, 36, 0.1);
    color: var(--premium);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Persistent Chat Widget */
.chat-widget {
    width: 350px;
    background-color: var(--bg-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 600px;
    position: sticky;
    top: 100px;
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
}

.chat-messages {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.message {
    display: flex;
    max-width: 80%;
}

.message.received { align-self: flex-start; }
.message.sent { align-self: flex-end; }

.bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    font-size: 0.9rem;
}

.received .bubble {
    background-color: var(--bg-input);
    border-bottom-left-radius: 0;
}

.sent .bubble {
    background-color: var(--primary);
    color: white;
    border-bottom-right-radius: 0;
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-input-area input {
    flex: 1;
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 0.5rem 1rem;
    color: white;
}
.chat-input-area input:focus { outline: none; border-color: var(--primary); }

.chat-input-area button {
    background-color: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
    background-color: var(--bg-input);
    border-radius: 1rem;
    width: fit-content;
}
.typing-indicator span {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.typing-indicator span:nth-child(2) { animation-delay: -0.16s; }
@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

@media (max-width: 1024px) {
    .portal-layout { flex-direction: column; }
    .chat-widget { width: 100%; position: static; height: 400px; }
}
