.alert-message {
    position: fixed;
    top: 12px;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    pointer-events: none;
    z-index: 9999999;
}

.alert-message * {
    text-align: initial !important;
    box-sizing: border-box !important;
}

.alert-content {
    position: relative;
    width: min(92vw, 620px);
    max-height: min(78vh, 700px);
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: auto;
    overflow: hidden;
    padding: 2px 4px;
    transform: translateY(-8px);
    transition: transform 0.28s ease;
}

.moved {
    transform: translateY(0);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(15, 23, 42, 0.34) transparent;
}

.moved::-webkit-scrollbar {
    width: 8px;
}

.moved::-webkit-scrollbar-track {
    background: transparent;
}

.moved::-webkit-scrollbar-thumb {
    background: rgba(15, 23, 42, 0.28);
    border-radius: 999px;
}

.message {
    position: relative;
    width: 100%;
    opacity: 0;
    animation: message-enter 0.36s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.message-container {
    position: relative;
    width: 100%;
    min-height: 70px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 14px 14px 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    background: linear-gradient(135deg, #3d8aee 0%, #4cc3bd 100%);
    color: #ffffff;
    backdrop-filter: blur(10px) saturate(130%);
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.message-container::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    border-radius: 4px;
    background: transparent;
}

.message-container:hover {
    transform: translateY(-1px);

}

.message-container.success {
    background: linear-gradient(135deg, #138a60 0%, #19b47f 100%);
    border-color: rgba(255, 255, 255, 0.24);
}

.message-container.info {
    background: linear-gradient(135deg, #1f66dc 0%, #3d8aee 100%);
    border-color: rgba(255, 255, 255, 0.24);
}

.message-container.warning {
    background: linear-gradient(135deg, #c78615 0%, #e9a527 100%);
    border-color: rgba(255, 255, 255, 0.24);
}

.message-container.error {
    background: linear-gradient(135deg, #c74443 0%, #e35b5a 100%);
    border-color: rgba(255, 255, 255, 0.24);
}

.message-img {
    width: 50px;
    height: 50px;
    margin: 0;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    filter: drop-shadow(0 3px 6px rgba(15, 23, 42, 0.32));
}

.close-msg {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 16px;
    height: 16px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    border: 0;
    cursor: pointer;
    justify-self: end;
    transition: transform 0.18s ease, opacity 0.18s ease;
    filter: drop-shadow(0 1px 2px rgba(15, 23, 42, 0.45));
}

.close-msg:hover {
    transform: scale(1.08);
    opacity: 0.86;
}

.message-text {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.message-text h4 {
    margin: 0;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.margtop {
    margin: 0;
    color: rgba(255, 255, 255, 0.95);
    font-size: 13px;
    line-height: 1.4;
}

.message-loading-bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 3px;
    border-bottom-left-radius: 16px;
    border-bottom-right-radius: 16px;
    background: rgba(255, 255, 255, 0.18);
    overflow: hidden;
}

.message-loading-bar::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.85) 0%, rgba(255, 255, 255, 0.45) 100%);
    animation: loading 5s linear forwards;
}

.message-success .message-loading-bar::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.5) 100%);
}

.message-info .message-loading-bar::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0.48) 100%);
}

.message-warning .message-loading-bar::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.52) 100%);
}

.message-error .message-loading-bar::before {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 255, 255, 0.52) 100%);
}

.message-content {
    display: flex;
    justify-content: center;
    flex-direction: column;
    width: 100%;
}

.message-content p {
    padding: 0 10px;
}

.show-input-content {
    display: flex;
    justify-content: center;
}

.input-color-box {
    border: 1px solid #e3e3e3;
    border-radius: 7px;
    margin: 5px;
    padding: 0 0 5px 0;
    width: calc(100% - 10px);
    display: flex;
    flex-direction: column;
}

.color-palette {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
}

.color-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 2px solid transparent;
    transition: border 0.2s ease, transform 0.2s;
    cursor: pointer;
    width: 36px;
    height: 36px;
}

.color-box {
    position: absolute;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    pointer-events: none;
}

.color-box.selected {
    width: 35px;
    height: 35px;
    transform: scale(1.1);
}

.color-wrapper:hover .color-box {
    width: 33px;
    height: 33px;
    transform: scale(1.1);
}

.fadeOut {
    animation: message-exit 0.34s ease forwards;
}

@keyframes loading {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes message-enter {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes message-exit {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-6px) scale(0.985);
    }
}

@media screen and (max-width: 1000px) {
    .alert-content {
        width: min(95vw, 620px);
    }

    .message-container {
        gap: 10px;
        min-height: 66px;
        border-radius: 14px;
        padding: 12px;
    }

    .message-loading-bar {
        border-bottom-left-radius: 14px;
        border-bottom-right-radius: 14px;
    }

    .message-img {
        width: 44px;
        height: 44px;
    }
}

@media screen and (max-width: 640px) {
    .alert-message {
        top: 8px;
    }

    .alert-content {
        width: calc(100vw - 14px);
        max-height: calc(100vh - 16px);
    }

    .message-container {
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "icon close"
            "text text";
        align-items: start;
        gap: 8px 10px;
        padding: 10px 10px 12px;
    }

    .message-img {
        grid-area: icon;
    }

    .close-msg {
        grid-area: close;
        margin-left: auto;
    }

    .message-text {
        grid-area: text;
    }
}
