/* ═══════════════════════════════════════════════════════════════════
   LYSA — Custom Styles (supplements Tailwind CSS)
   ═══════════════════════════════════════════════════════════════════ */

/* ── Screen Switching SPA ──────────────────────────────────── */
.screen {
    display: none;
    flex-direction: column;
    width: 100%;
    min-height: calc(100vh - 64px); /* Account for fixed nav (reduced height) */
}
.screen.active {
    display: flex;
}

/* ── Navigation ───────────────────────────────────────────── */
.nav-link.active {
    background: rgba(255, 179, 177, 0.1);
    color: #ffb3b1 !important;
}

#nav-notif-badge:not(.hidden) {
    animation: badge-pulse 2s ease-in-out infinite;
}
@keyframes badge-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* ── Glass Panels ──────────────────────────────────────────── */
.glass-panel {
    background: rgba(43, 28, 27, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(247, 220, 219, 0.05);
}

.glass-panel-light {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.2);
}

.glass-card {
    background: rgba(43, 28, 27, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 179, 177, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.glass-input {
    background: rgba(29, 16, 15, 0.9) !important; /* Darker dark-red/brown background */
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid #5a4040 !important;
    color: #f7dcdb !important;
}

.glass-input::placeholder {
    color: rgba(226, 190, 189, 0.6) !important; /* Semi-transparent light-pink/grey */
}

/* ── Hover Effects ─────────────────────────────────────────── */
.soft-glow-hover:hover {
    box-shadow: 0 0 25px rgba(255, 179, 177, 0.3);
    transform: translateY(-2px);
    transition: all 0.3s ease;
}

.romantic-glow:hover {
    box-shadow: 0 0 20px rgba(255, 90, 96, 0.2);
    border-color: rgba(255, 90, 96, 0.3);
}

/* ── Portrait Overlay ──────────────────────────────────────── */
.soft-portrait {
    position: relative;
    box-shadow: 0 0 40px rgba(255, 179, 177, 0.1);
}
.soft-portrait::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(29, 16, 15, 0.9) 0%, rgba(29, 16, 15, 0) 50%);
    pointer-events: none;
}

/* ── Affinity Bar ──────────────────────────────────────────── */
.affinity-bar {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    overflow: hidden;
}
.affinity-fill {
    height: 100%;
    background: linear-gradient(90deg, #ffb3b1, #c0c1ff);
    border-radius: 999px;
    transition: width 0.5s ease;
}

/* ── Pill Tags ─────────────────────────────────────────────── */
.pill-tag {
    background: rgba(255, 179, 177, 0.1);
    border: 1px solid rgba(255, 179, 177, 0.2);
    color: #ffb3b1;
    transition: all 0.2s ease;
}
.pill-tag:hover {
    background: rgba(255, 179, 177, 0.2);
}

.pill-tag-neutral {
    background: rgba(43, 28, 27, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e2bebd;
}

/* ── Custom Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: #413130;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a98988;
}

/* ── Animations ────────────────────────────────────────────── */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

@keyframes float-xp {
    0%   { opacity: 1; transform: translateY(0); }
    100% { opacity: 0; transform: translateY(-30px); }
}

/* ── XP Float ──────────────────────────────────────────────── */
.xp-change {
    position: absolute;
    right: 10px;
    top: -5px;
    font-size: 0.85rem;
    font-weight: 700;
    animation: float-xp 1.2s ease forwards;
    pointer-events: none;
    z-index: 10;
}
.xp-change.positive { color: #59dda8; }
.xp-change.negative { color: #ff5a60; }

/* ── Level Notification ────────────────────────────────────── */
.level-notification {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    z-index: 100;
    background: rgba(43, 28, 27, 0.95);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 179, 177, 0.3);
    border-radius: 1rem;
    padding: 2rem 3rem;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}
.level-notification.show {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    pointer-events: auto;
}
.level-notification.level-down {
    border-color: rgba(255, 90, 96, 0.3);
}
.level-notif-emoji { font-size: 2.5rem; margin-bottom: 0.5rem; }
.level-notif-title { font-family: 'Playfair Display', serif; font-size: 1.3rem; color: #ffb3b1; margin-bottom: 0.3rem; }
.level-notif-label { font-size: 1rem; color: #f7dcdb; font-weight: 600; }
.level-notif-description { font-size: 0.85rem; color: #e2bebd; margin-top: 0.5rem; }

/* ── Bot Disconnect/Reconnect ──────────────────────────────── */
.bot-disconnected {
    text-align: center;
    padding: 2rem;
    margin: 1.5rem 0;
    border-radius: 1rem;
    background: rgba(43, 28, 27, 0.5);
    border: 1px solid rgba(255, 90, 96, 0.15);
    animation: fadeInUp 0.4s ease;
}
.disconnect-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.disconnect-text { color: #f7dcdb; font-size: 0.95rem; margin-bottom: 0.3rem; }
.disconnect-timer { color: #ffb3b1; font-size: 0.85rem; }
.disconnect-sub { color: #a98988; font-size: 0.8rem; margin-top: 0.5rem; }
.disconnect-btn {
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 179, 177, 0.1);
    border: 1px solid rgba(255, 179, 177, 0.2);
    border-radius: 9999px;
    color: #ffb3b1;
    cursor: pointer;
    font-family: inherit;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}
.disconnect-btn:hover {
    background: rgba(255, 179, 177, 0.2);
}

.bot-reconnected {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    margin: 1rem auto;
    background: rgba(89, 221, 168, 0.1);
    border: 1px solid rgba(89, 221, 168, 0.2);
    border-radius: 9999px;
    animation: fadeInUp 0.4s ease;
    width: fit-content;
}
.reconnect-dot {
    width: 8px;
    height: 8px;
    background: #59dda8;
    border-radius: 50%;
    animation: pulse 2s infinite;
}
.reconnect-text { color: #59dda8; font-size: 0.85rem; }

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ── Blocked State ─────────────────────────────────────────── */
.chat-input-area.blocked {
    opacity: 0.5;
    pointer-events: none;
}

.blocked-message {
    text-align: center;
    padding: 1.5rem;
    margin: 1rem 0;
    border-radius: 1rem;
    background: rgba(43, 28, 27, 0.5);
    border: 1px solid rgba(255, 90, 96, 0.15);
    animation: fadeInUp 0.4s ease;
}
.blocked-icon { font-size: 1.5rem; }
.blocked-message p { color: #e2bebd; font-size: 0.9rem; margin-top: 0.3rem; }
.blocked-reason { color: #a98988; font-size: 0.8rem; font-style: italic; }

/* ── Photo Message Bubble ──────────────────────────────────── */
.message-photo-wrapper {
    align-self: flex-start;
}
.message-photo {
    width: 260px;
    max-width: 100%;
    border-radius: 1rem;
    overflow: hidden;
    background: rgba(43, 28, 27, 0.6);
    border: 1px solid rgba(255, 179, 177, 0.1);
}
.message-photo img {
    width: 100%;
    display: block;
    border-radius: 1rem 1rem 0 0;
    cursor: pointer;
    transition: transform 0.3s ease;
}
.message-photo img:hover {
    transform: scale(1.02);
}
.message-photo-caption {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #e2bebd;
    font-style: italic;
    line-height: 1.4;
}

/* ── Photo Lightbox ────────────────────────────────────────── */
.photo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: opacity 0.3s ease;
}
.photo-lightbox img {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 0.5rem;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    animation: scaleIn 0.3s ease;
}

/* ── Typing indicator ──────────────────────────────────────── */
.typing-indicator {
    display: flex;
    gap: 0.75rem;
    max-width: 85%;
    margin-right: auto;
    animation: fadeInUp 0.3s ease;
}
.typing-dots {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    border-bottom-left-radius: 0.125rem;
    background: #362625;
}
.typing-dot {
    width: 6px;
    height: 6px;
    background: #e2bebd;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}
.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.1s; }
.typing-dot:nth-child(3) { animation-delay: 0.2s; }

@keyframes bounce {
    0%, 80%, 100% { transform: scale(0); }
    40% { transform: scale(1); }
}

/* ── Onboarding Gender Cards ───────────────────────────────── */
.gender-card {
    cursor: pointer;
    padding: 1.5rem 2rem;
    border-radius: 0.75rem;
    background: rgba(43, 28, 27, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    text-align: center;
}
.gender-card:hover {
    border-color: rgba(255, 179, 177, 0.3);
    background: rgba(43, 28, 27, 0.6);
}
.gender-card.selected {
    border-color: #ffb3b1;
    background: rgba(255, 179, 177, 0.1);
    box-shadow: 0 0 15px rgba(255, 179, 177, 0.15);
}
.gender-emoji { font-size: 2rem; margin-bottom: 0.5rem; }
.gender-label { color: #f7dcdb; font-size: 0.95rem; }

/* ── Sidebar Gallery ───────────────────────────────────────── */
.gallery-slot {
    aspect-ratio: 1 / 1;
    border-radius: 0.5rem;
    overflow: hidden;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(29, 16, 15, 0.4);
    border: 1px dashed rgba(255, 179, 177, 0.15);
    transition: all 0.3s ease;
}

.gallery-slot.locked {
    cursor: help;
}

.gallery-slot.locked:hover {
    border-color: rgba(255, 179, 177, 0.4);
    background: rgba(29, 16, 15, 0.6);
}

.gallery-slot.locked span {
    font-family: 'Playfair Display', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: rgba(255, 179, 177, 0.25);
    transition: color 0.3s ease;
}

.gallery-slot.locked:hover span {
    color: rgba(255, 179, 177, 0.6);
}

.gallery-slot.unlocked {
    border: 1px solid rgba(255, 179, 177, 0.2);
    cursor: pointer;
}

.gallery-slot.unlocked img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-slot.unlocked:hover img {
    transform: scale(1.1);
}

.gallery-slot.unlocked:hover {
    border-color: #ffb3b1;
    box-shadow: 0 0 10px rgba(255, 179, 177, 0.2);
}

/* ── Economy: Coin Animation ───────────────────────────────── */
.coin-animation {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 28px;
    font-weight: 700;
    color: #ffb3b1;
    text-shadow: 0 0 20px rgba(255, 179, 177, 0.6);
    pointer-events: none;
    z-index: 9999;
    animation: coinFloat 1.5s ease-out forwards;
}

@keyframes coinFloat {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(0.5);
    }
    30% {
        opacity: 1;
        transform: translate(-50%, -60%) scale(1.2);
    }
    100% {
        opacity: 0;
        transform: translate(-50%, -120%) scale(1);
    }
}

/* ── Economy: Message Counter Premium ──────────────────────── */
.message-counter-wrapper.premium {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(250, 204, 21, 0.15));
    border-color: rgba(245, 158, 11, 0.3);
}

.message-counter-wrapper.premium span {
    color: #facc15;
}

/* ── Max Level Bar Pulse ──────────────────────────────────── */
@keyframes maxLevelPulse {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}
