/* ═══════════════════════════════════════════════
   Message Alert
═══════════════════════════════════════════════ */
#message {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* ── Close Button ── */
#message .close {
    content: "";
    width: 50px;
    height: 50px;
    position: fixed;
    top: 90px;
    left: 10px;
    z-index: 10;
    cursor: pointer;
    border: none;
    border-radius: 12px;
    background-color: #1a1f36;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cline x1='18' y1='6' x2='6' y2='18'%3e%3c/line%3e%3cline x1='6' y1='6' x2='18' y2='18'%3e%3c/line%3e%3c/svg%3e");
    background-size: 18px;
    background-repeat: no-repeat;
    background-position: center;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06) inset, 0 6px 20px rgba(0, 0, 0, 0.35);
    animation: popIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    transition: background-color 0.2s, transform 0.2s;
}

#message .close:hover {
    background-color: #e53e3e;
    transform: rotate(90deg) scale(1.08);
}

/* ── Message Card ── */
#message .message {
    position: fixed;
    height: 50px;
    width: auto;
    top: 90px;
    left: 70px;
    padding: 0 18px 0 14px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    border-radius: 0 12px 12px 0;
    border-left: 3px solid #4f9cf9;
    background: #1a1f36;
    color: #e2e8f0;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.05) inset, 0 8px 32px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(79, 156, 249, 0.2);
    overflow: hidden;
    animation: slideIn 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    white-space: nowrap;
}

#message .message::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 60%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(79, 156, 249, 0.08), transparent);
    animation: sweep 2.5s ease 0.5s infinite;
}

#message .message::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 0%, #4f9cf9 30%, #a78bfa 70%, transparent 100%);
    background-size: 200% 100%;
    animation: glowLine 3s linear infinite;
}

#message .message .text::before {
    content: '';
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4f9cf9;
    margin-right: 10px;
    box-shadow: 0 0 8px #4f9cf9;
    flex-shrink: 0;
    animation: pulse 1.8s ease infinite;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

#message .message .text {
    height: auto;
    float: none;
    font-weight: 600;
    color: #e2e8f0;
    font-size: 14px;
    letter-spacing: 0.01em;
    max-width: min(450px, calc(100vw - 140px));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: flex;
    align-items: center;
}

/* ═══════════════════════════════════════════════
   RTL Support
═══════════════════════════════════════════════ */

html[dir="rtl"] #message .close {
    left: auto;
    right: 10px;
}

html[dir="rtl"] #message .message {
    left: auto;
    right: 70px;
    border-left: none;
    border-right: 3px solid #4f9cf9;
    border-radius: 12px 0 0 12px;
}

html[dir="rtl"] #message .message::before {
    left: auto;
    right: -100%;
}

html[dir="rtl"] #message .message .text::before {
    margin-right: 0;
    margin-left: 10px;
}