/* ==========================================================================
   FORUM / chatroom — shared messages between us
   ========================================================================== */
.forum {
    margin-top: 70px;
    padding: 20px 0;
    position: relative;
}

.forum-card {
    position: relative;
    background:
        radial-gradient(ellipse at 30% 0%, rgba(255, 220, 230, .55), transparent 60%),
        linear-gradient(180deg, #fff8f4 0%, #fde9ee 100%);
    border: 1px solid var(--hairline-2);
    border-radius: 22px;
    padding: 24px 24px 18px;
    box-shadow:
        0 1px 0 rgba(255,255,255,.7) inset,
        0 18px 40px -22px rgba(146, 82, 106, .3);
    overflow: hidden;
}

.forum-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 14px;
}
.forum-title .eyebrow { margin-bottom: 4px; }
.forum-title h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }

.forum-tiara {
    flex-shrink: 0;
    filter: drop-shadow(0 4px 8px rgba(184, 134, 46, .35));
    animation: tiaraSparkle 4s ease-in-out infinite;
    transform-origin: center;
}
@keyframes tiaraSparkle {
    0%, 100% { transform: rotate(-3deg) scale(1); }
    50%      { transform: rotate(3deg)  scale(1.04); }
}

.forum-messages {
    max-height: 540px;
    min-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 4px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-behavior: smooth;
    border-top: 1px dashed rgba(217, 122, 139, .28);
    border-bottom: 1px dashed rgba(217, 122, 139, .28);
    margin-bottom: 14px;
}
.forum-messages::-webkit-scrollbar { width: 8px; }
.forum-messages::-webkit-scrollbar-thumb {
    background: rgba(217, 122, 139, .25);
    border-radius: 999px;
}
.forum-messages::-webkit-scrollbar-track { background: transparent; }

.forum-empty {
    padding: 50px 16px;
    text-align: center;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: var(--ink-faint);
}

/* Message bubbles */
.forum-msg {
    max-width: 76%;
    padding: 9px 14px 10px;
    border-radius: 18px;
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    line-height: 1.45;
    word-break: break-word;
    box-shadow: 0 4px 10px -6px rgba(146, 82, 106, .25);
    position: relative;
    animation: msgPop .26s cubic-bezier(.4, 1.4, .4, 1);
}
@keyframes msgPop {
    from { opacity: 0; transform: translateY(6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

.forum-msg.hins {
    align-self: flex-start;
    background: linear-gradient(135deg, #e6f1fb 0%, #d1e6f8 100%);
    color: #1f3a5c;
    border: 1px solid rgba(106, 169, 236, .25);
    border-bottom-left-radius: 6px;
}
.forum-msg.rania {
    align-self: flex-end;
    background: linear-gradient(135deg, #fff0f4 0%, #ffdbe5 100%);
    color: #6b2a3a;
    border: 1px solid rgba(217, 122, 139, .28);
    border-bottom-right-radius: 6px;
}

.forum-msg-meta {
    display: block;
    font-size: 0.62rem;
    letter-spacing: .04em;
    opacity: .65;
    margin-top: 4px;
    font-weight: 500;
}
.forum-msg.hins  .forum-msg-meta { color: #4a90e2; }
.forum-msg.rania .forum-msg-meta { color: #c8556a; }

.forum-msg-delete {
    position: absolute;
    top: 4px; right: 6px;
    width: 18px; height: 18px;
    border: 0;
    background: transparent;
    color: currentColor;
    opacity: 0;
    cursor: pointer;
    display: grid; place-items: center;
    border-radius: 50%;
    transition: opacity var(--t-fast), background var(--t-fast);
}
.forum-msg:hover .forum-msg-delete { opacity: .55; }
.forum-msg-delete:hover { opacity: 1 !important; background: rgba(0,0,0,.06); }

/* Compose */
.forum-compose {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}
#forum-input {
    flex: 1;
    min-width: 0;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--hairline);
    background: rgba(255, 255, 255, .9);
    font: 400 0.9rem 'Inter', sans-serif;
    color: var(--ink);
    transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
#forum-input:focus {
    outline: none;
    border-color: var(--rose-deep);
    box-shadow: 0 0 0 3px rgba(217, 122, 139, .15);
}
#forum-input::placeholder { color: var(--ink-faint); }
#forum-input:disabled { opacity: .55; cursor: not-allowed; }

.forum-send {
    width: 44px; height: 44px;
    flex-shrink: 0;
    border-radius: 50%;
    border: 0;
    background: linear-gradient(135deg, var(--pink-300), var(--rose-deep));
    color: white;
    cursor: pointer;
    display: grid; place-items: center;
    box-shadow: 0 6px 16px -6px rgba(178, 88, 103, .55);
    transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.forum-send:hover { transform: translateY(-1px) scale(1.04); }
.forum-send:active { transform: translateY(0) scale(.98); }
.forum-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.forum-send svg { transform: translate(-1px, 1px); }

@media (max-width: 600px) {
    .forum-card { padding: 18px 16px 14px; }
    .forum-msg { max-width: 86%; font-size: 0.86rem; }
    .forum-tiara svg { width: 44px; height: 28px; }
}
