/* ===== Base mood ===== */
:root {
    --glass-bg: rgb(7, 15, 39);
    --glass-border: rgb(23, 27, 66);
    --soft-white: rgba(255, 255, 255, 0.85);
}

* {
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: "Vazirmatn", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: radial-gradient(1200px 600px at 70% 20%, rgba(18, 18, 81, 0.8), transparent 60%),
    radial-gradient(900px 500px at 20% 80%, rgba(140, 90, 110, 0.08), transparent 60%),
    linear-gradient(180deg, #06070b 0%, #171b42 40%, #05060a 100%);
}

/* Fullscreen canvas behind everything */
#rainCanvas {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* Extra mood/vignette overlay */
.mood-overlay {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
            radial-gradient(900px 500px at 50% 20%, rgba(7, 6, 55, 0.8), transparent 60%),
            radial-gradient(900px 700px at 50% 120%, rgba(42, 7, 138, 0.55), transparent 60%),
            linear-gradient(180deg, rgba(0,0,0,0.55), rgb(5, 3, 46));
    mix-blend-mode: normal;
}

/* Glass container */
.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 22px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
            0 20px 60px rgba(0,0,0,0.45),
            inset 0 1px 0 rgba(255,255,255,0.05);
}

/* Glass inputs */
.glass-input {
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: 18px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    outline: none;
    transition: border-color 200ms ease, background 200ms ease;
    color: rgba(255,255,255,0.92);
}
.glass-input:focus {
    border-color: rgba(255,255,255,0.20);
    background: rgba(0, 0, 0, 0.28);
}

/* Tabs */
.tab-btn {
    padding: 10px 14px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.86);
    transition: background 220ms ease, transform 220ms ease, border-color 220ms ease;
}
.tab-btn:hover {
    background: rgba(255,255,255,0.10);
}
.tab-btn:active {
    transform: translateY(1px);
}
.tab-active {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.20);
}

/* Status pill */
.status-pill {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.94);
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(255,255,255,0.06);
}

/* Message cards */
.message-card {
    position: relative;
    overflow: hidden;
    border-radius: 18px;
    padding: 14px 14px 12px;
    border: 1px solid rgba(255,255,255,0.10);
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow:
            0 18px 50px rgba(0,0,0,0.35),
            inset 0 1px 0 rgba(255,255,255,0.04);
    transform: translateY(10px);
    opacity: 0;
    transition: opacity 700ms ease, transform 700ms ease;
}

/* Soft highlight line */
.message-card::before {
    content: "";
    position: absolute;
    inset: -40% -40%;
    background: radial-gradient(circle at 30% 20%, rgba(255,255,255,0.06), transparent 40%);
    transform: rotate(-12deg);
    pointer-events: none;
}

.message-card.show {
    opacity: 1;
    transform: translateY(0);
}

.message-text {
    color: rgba(255,255,255,0.90);
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
}

.message-meta {
    margin-top: 10px;
    font-size: 11px;
    color: rgba(255,255,255,0.55);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

/* Floating feeling (subtle) */
@keyframes floaty {
    0%   { transform: translateY(0px); }
    50%  { transform: translateY(-6px); }
    100% { transform: translateY(0px); }
}
.floaty {
    animation: floaty 6.5s ease-in-out infinite;
}

/* Dissolve layer overlay */
.dissolve-layer {
    position: fixed;
    inset: 0;
    z-index: 30;
    pointer-events: none;
}

/* Dissolve text style */
.dissolve-word {
    position: absolute;
    direction: rtl;
    unicode-bidi: plaintext;
    color: rgba(255,255,255,0.88);
    text-shadow: 0 18px 40px rgba(0,0,0,0.55);
    filter: drop-shadow(0 10px 30px rgba(0,0,0,0.40));
    font-size: 18px;
    line-height: 2;
    max-width: min(520px, 86vw);
    padding: 12px 14px;
    border-radius: 16px;
    background: rgba(0,0,0,0.20);
    border: 1px solid rgba(255,255,255,0.10);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Each character becomes a droplet */
.dissolve-char {
    display: inline-block;
    will-change: transform, opacity, filter;
}

/* Small helper (reduce motion) */
@media (prefers-reduced-motion: reduce) {
    .message-card,
    .tab-btn,
    .floaty {
        transition: none !important;
        animation: none !important;
    }
}
