/* messages.css — anonymous message widget */

.msg-trigger {
    color: var(--accent);
    opacity: 0.7;
    font-size: 0.7rem;
    cursor: pointer;
    transition: opacity 0.3s;
    letter-spacing: 0.05em;
}

.msg-trigger:hover {
    opacity: 1;
}

/* Fallback floating button (used when no .msg-trigger in HTML) */
.msg-toggle {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 900;
    width: 32px;
    height: 32px;
    border: 1px solid rgba(196, 160, 255, 0.2);
    border-radius: 50%;
    background: rgba(10, 10, 10, 0.8);
    color: var(--fg-dim);
    font-size: 0.7rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.3s, opacity 0.3s;
    opacity: 0.4;
    backdrop-filter: blur(4px);
}

.msg-toggle:hover {
    opacity: 1;
    border-color: var(--accent);
}

.msg-panel {
    position: fixed;
    bottom: 0;
    right: 0;
    width: 340px;
    max-height: 70vh;
    z-index: 1000;
    background: rgba(15, 15, 18, 0.95);
    border-left: 1px solid rgba(196, 160, 255, 0.1);
    border-top: 1px solid rgba(196, 160, 255, 0.1);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    backdrop-filter: blur(12px);
}

.msg-panel.open {
    transform: translateX(0);
}

.msg-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(196, 160, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.msg-header h3 {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: lowercase;
    color: var(--fg-dim);
}

.msg-close {
    background: none;
    border: none;
    color: var(--fg-dim);
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    line-height: 1;
}

.msg-close:hover {
    color: var(--fg);
}

.msg-list {
    padding: 0.75rem 1rem;
    padding-bottom: 16rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.msg-list::-webkit-scrollbar {
    width: 3px;
}

.msg-list::-webkit-scrollbar-thumb {
    background: rgba(196, 160, 255, 0.2);
}

.msg-item {
    border-left: 1px solid rgba(196, 160, 255, 0.15);
    padding-left: 0.75rem;
}

.msg-item .msg-name {
    font-size: 0.8rem;
    color: var(--accent);
    opacity: 0.6;
    font-family: var(--font-mono);
}

.msg-item .msg-body {
    font-size: 0.9rem;
    color: var(--fg);
    line-height: 1.5;
    margin-top: 0.2rem;
    word-break: break-word;
}

.msg-item .msg-time {
    font-size: 0.75rem;
    color: var(--fg);
    opacity: 0.4;
    font-family: var(--font-mono);
    margin-top: 0.2rem;
}

.msg-empty {
    text-align: center;
    color: var(--fg-dim);
    opacity: 0.4;
    font-size: 0.8rem;
    padding: 2rem 0;
    font-style: italic;
}

.msg-form {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.75rem 1rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    border-top: 1px solid rgba(196, 160, 255, 0.1);
    background: rgba(12, 12, 15, 0.98);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 20;
}

.msg-name-row {
    display: flex;
    gap: 0.4rem;
    align-items: center;
}

.msg-name-label {
    font-size: 0.8rem;
    color: var(--fg);
    opacity: 0.8;
    white-space: nowrap;
    letter-spacing: 0.05em;
}

.msg-name-row input {
    flex: 1;
}

.msg-rand {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    color: var(--fg);
    font-size: 1rem;
    width: 2.2rem;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.msg-rand:hover {
    border-color: var(--accent);
    background: rgba(196, 160, 255, 0.1);
}

.msg-form input,
.msg-form textarea {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 3px;
    color: var(--fg);
    font-family: var(--font-body);
    font-size: 0.9rem;
    padding: 0.5rem 0.7rem;
    outline: none;
    transition: border-color 0.2s;
}

.msg-form input:focus,
.msg-form textarea:focus {
    border-color: var(--accent);
}

.msg-form input::placeholder,
.msg-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.msg-form textarea {
    resize: vertical;
    min-height: 3rem;
    max-height: 8rem;
}

.msg-form button {
    align-self: flex-end;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 3px;
    color: var(--fg);
    font-size: 0.75rem;
    padding: 0.35rem 1rem;
    cursor: pointer;
    letter-spacing: 0.05em;
    transition: border-color 0.2s, background 0.2s;
}

.msg-form button:hover {
    border-color: var(--accent);
    background: rgba(196, 160, 255, 0.1);
}

.msg-form button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.msg-status {
    font-size: 0.7rem;
    text-align: center;
    padding: 0.2rem;
}

.msg-status.error { color: #e55; }
.msg-status.ok { color: var(--accent); }

@media (max-width: 640px) {
    .msg-panel {
        width: 100%;
        max-height: 60vh;
    }

    .msg-toggle {
        bottom: 1rem;
        right: 1rem;
    }
}
