﻿/* ==========================================================================
   OTTAWA PUNJABIS - INBOX & MATRIMONIAL CHAT STYLING
   Glassmorphism theme, Matrimonial badges, and Paywall Modal
   ========================================================================== */

/* Matrimonial Match Badge */
.badge-matrimonial {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.22rem 0.65rem;
    background: linear-gradient(135deg, rgba(244, 63, 94, 0.14) 0%, rgba(225, 29, 72, 0.22) 100%);
    color: #e11d48;
    border: 1px solid rgba(244, 63, 94, 0.35);
    border-radius: 9999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    box-shadow: 0 2px 6px rgba(225, 29, 72, 0.12);
    line-height: 1.2;
    flex-shrink: 0;
}

.badge-matrimonial i {
    color: #f43f5e;
    font-size: 0.72rem;
}

/* Thread Item Enhancements */
.thread-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(226, 232, 240, 0.7);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.thread-item:hover {
    background: rgba(255, 81, 47, 0.06);
}

.thread-item.active {
    background: rgba(255, 81, 47, 0.1);
    border-left: 4px solid var(--primary);
}

.thread-item.unread {
    background: #fffbeb;
    border-left: 4px solid var(--primary);
}

.thread-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.thread-user-meta {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}

.thread-name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.thread-date {
    font-size: 0.72rem;
    color: #94a3b8;
    font-weight: 600;
    flex-shrink: 0;
}

.thread-preview {
    font-size: 0.85rem;
    color: #64748b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.4;
}

/* Chat Header */
.chat-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-subtle);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    z-index: 10;
}

.chat-header-left {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-width: 0;
}

.chat-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.chat-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-partner-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.chat-partner-title-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.chat-partner-name {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-partner-sub {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-back-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: #64748b;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.chat-back-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #0f172a;
}

/* Chat Messages */
.chat-messages {
    flex: 1;
    padding: 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    background: rgba(248, 250, 252, 0.65);
    scroll-behavior: smooth;
}

.msg-bubble {
    max-width: 72%;
    padding: 0.85rem 1.15rem;
    border-radius: 18px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-break: break-word;
}

.msg-received {
    background: #ffffff;
    color: #1e293b;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--border-subtle);
}

.msg-sent {
    background: var(--gradient-primary);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 16px rgba(255, 81, 47, 0.25);
}

.msg-time {
    font-size: 0.68rem;
    margin-top: 0.35rem;
    opacity: 0.82;
    text-align: right;
}

.msg-sent .msg-time {
    color: rgba(255, 255, 255, 0.9);
}

.msg-received .msg-time {
    color: #94a3b8;
}

/* Glassmorphic Paywall Modal Overlay */
.paywall-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    padding: 1.25rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.paywall-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

/* Paywall Card */
.paywall-card {
    position: relative;
    width: 100%;
    max-width: 520px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 24px 60px -12px rgba(15, 23, 42, 0.35),
                0 0 40px rgba(255, 81, 47, 0.15);
    border-radius: 28px;
    padding: 2.25rem 2rem;
    text-align: center;
    transform: scale(0.92) translateY(10px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.paywall-overlay.active .paywall-card {
    transform: scale(1) translateY(0);
}

/* Paywall Decorative Ambient Blobs */
.paywall-glow-orb {
    position: absolute;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

.paywall-glow-1 {
    top: -60px;
    right: -60px;
    background: linear-gradient(135deg, #FF512F, #DD2476);
}

.paywall-glow-2 {
    bottom: -60px;
    left: -60px;
    background: linear-gradient(135deg, #38bdf8, #6366f1);
}

/* Paywall Content */
.paywall-content {
    position: relative;
    z-index: 1;
}

.paywall-close-x {
    position: absolute;
    top: 1rem;
    right: 1.15rem;
    background: rgba(241, 245, 249, 0.85);
    border: 1px solid var(--border-subtle);
    color: #64748b;
    font-size: 1.35rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    line-height: 1;
    z-index: 2;
}

.paywall-close-x:hover {
    background: #e2e8f0;
    color: #0f172a;
    transform: rotate(90deg);
}

.paywall-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.95rem;
    background: linear-gradient(135deg, rgba(255, 81, 47, 0.12), rgba(221, 36, 118, 0.14));
    color: #e11d48;
    border: 1px solid rgba(244, 63, 94, 0.3);
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.paywall-badge-pill i {
    color: #f43f5e;
}

.paywall-title {
    font-size: 1.55rem;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: -0.02em;
    margin-bottom: 0.45rem;
    line-height: 1.25;
}

.paywall-subtitle {
    font-size: 0.92rem;
    color: #64748b;
    margin-bottom: 1.35rem;
    line-height: 1.5;
}

/* Plan Highlight Box */
.paywall-tier-card {
    background: linear-gradient(135deg, #ffffff 0%, #fff7ed 100%);
    border: 2px solid rgba(255, 81, 47, 0.3);
    border-radius: 20px;
    padding: 1.25rem 1.4rem;
    margin-bottom: 1.35rem;
    text-align: left;
    box-shadow: 0 10px 25px -5px rgba(255, 81, 47, 0.12);
    position: relative;
    overflow: hidden;
}

.paywall-tier-featured-tag {
    position: absolute;
    top: 0.65rem;
    right: 0.75rem;
    background: var(--gradient-primary);
    color: white;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.2rem 0.6rem;
    border-radius: 9999px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.paywall-tier-name {
    font-size: 1.15rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 0.35rem;
}

.paywall-tier-name i {
    color: #f59e0b;
}

.paywall-rate-row {
    display: flex;
    align-items: baseline;
    gap: 0.45rem;
    margin-bottom: 0.85rem;
}

.paywall-price {
    font-size: 1.7rem;
    font-weight: 900;
    color: #0f172a;
    letter-spacing: -0.03em;
}

.paywall-price-sub {
    font-size: 0.82rem;
    color: #64748b;
    font-weight: 600;
}

.paywall-rate-pill {
    display: inline-block;
    background: rgba(16, 185, 129, 0.12);
    color: #059669;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    margin-left: 0.25rem;
}

/* Perks List */
.paywall-perks-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding-top: 0.85rem;
}

.paywall-perks-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.87rem;
    color: #334155;
    line-height: 1.35;
}

.paywall-perks-list li i {
    color: #10b981;
    font-size: 0.95rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

/* Action Buttons */
.paywall-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-paywall-stripe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.95rem 1.5rem;
    background: linear-gradient(135deg, #635bff 0%, #4338ca 100%);
    color: #ffffff !important;
    text-decoration: none;
    font-size: 1rem;
    font-weight: 800;
    border-radius: 14px;
    box-shadow: 0 8px 24px -4px rgba(99, 91, 255, 0.45);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
}

.btn-paywall-stripe:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px -2px rgba(99, 91, 255, 0.55);
    background: linear-gradient(135deg, #5348eb 0%, #3730a3 100%);
    color: #ffffff !important;
}

.btn-paywall-stripe i {
    font-size: 1.35rem;
}

.btn-paywall-close {
    width: 100%;
    padding: 0.75rem 1.25rem;
    background: rgba(241, 245, 249, 0.8);
    color: #475569;
    border: 1px solid var(--border-subtle);
    border-radius: 14px;
    font-size: 0.92rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-paywall-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.paywall-security-note {
    margin-top: 0.95rem;
    font-size: 0.75rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.paywall-security-note i {
    color: #10b981;
}

/* Toast Notifications */
.inbox-toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    pointer-events: none;
    max-width: 420px;
}

.inbox-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.95rem 1.25rem;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: #f8fafc;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.4;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.12);
    animation: toastSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    transition: all 0.25s ease;
}

.inbox-toast.toast-warning {
    border-left: 4px solid #f59e0b;
}

.inbox-toast.toast-error {
    border-left: 4px solid #ef4444;
}

.inbox-toast.toast-success {
    border-left: 4px solid #10b981;
}

.inbox-toast-icon {
    font-size: 1.1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.toast-warning .inbox-toast-icon { color: #fbbf24; }
.toast-error .inbox-toast-icon { color: #f87171; }
.toast-success .inbox-toast-icon { color: #34d399; }

.inbox-toast-message {
    flex: 1;
}

.inbox-toast-close {
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0;
    margin-left: 0.25rem;
    line-height: 1;
}

.inbox-toast-close:hover {
    color: #f8fafc;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .chat-back-btn {
        display: inline-flex;
    }
    
    .inbox-container.mobile-chat-active .thread-list {
        display: none !important;
    }
    
    .inbox-container.mobile-chat-active .chat-area {
        display: flex !important;
    }
    
    .inbox-container:not(.mobile-chat-active) .chat-area {
        display: none !important;
    }
    
    .paywall-card {
        padding: 1.75rem 1.25rem;
    }
    
    .inbox-toast-container {
        left: 16px;
        right: 16px;
        bottom: 16px;
        max-width: none;
    }
}
