 /**
 * NOTICE OF LICENSE
 *
 * This file is licenced under the Software License Agreement.
 * With the purchase or the installation of the software in your application
 * you accept the licence agreement.
 *
 * You must not modify, adapt or create derivative works of this source code
 *
 * @author    WePresta <contact@wepresta.com>
 * @copyright Since 2024 WePresta
 * @license   LICENSE.txt
 */

/* WePresta Product Message Rules - Front Office Styles */

/* Messages container */
.wepresta-pmr-messages {
    width: 100%;
}

/* Loading state */
.wepresta-pmr-messages[data-loading="true"] {
    opacity: 0.6;
    position: relative;
}

.wepresta-pmr-messages[data-loading="true"]::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: wepresta-pmr-spin 0.6s linear infinite;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
}

@keyframes wepresta-pmr-spin {
    to { transform: rotate(360deg); }
}

/* Individual message */
.wepresta-pmr-message {
    margin: 10px 0;
    line-height: 1.5;
    font-size: 14px;
}

/* Message content formatting */
.wepresta-pmr-message p {
    margin: 0 0 0.5em;
}

.wepresta-pmr-message p:last-child {
    margin-bottom: 0;
}

.wepresta-pmr-message a {
    text-decoration: underline;
}

.wepresta-pmr-message strong,
.wepresta-pmr-message b {
    font-weight: 700;
}

/* Fade in animation for AJAX updates */
.wepresta-pmr-message {
    animation: wepresta-pmr-fadeIn 0.3s ease-in-out;
}

@keyframes wepresta-pmr-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* CTA inside message content */
.wepresta-pmr-message__content--cta-inside {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wepresta-pmr-message__content--cta-left,
.wepresta-pmr-message__content--cta-right {
    flex-direction: row;
}

.wepresta-pmr-message__content--cta-left .wepresta-pmr-message__text,
.wepresta-pmr-message__content--cta-right .wepresta-pmr-message__text {
    flex: 1 1 auto;
    min-width: 0;
}

.wepresta-pmr-message__content--cta-left .wepresta-pmr-cta-inline,
.wepresta-pmr-message__content--cta-right .wepresta-pmr-cta-inline {
    flex-shrink: 0;
    margin: 0;
}

.wepresta-pmr-message__content--cta-below {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.wepresta-pmr-message__text {
    flex: 1 1 auto;
    min-width: 0;
}

.wepresta-pmr-cta-inline .wepresta-pmr-cta {
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .wepresta-pmr-message {
        padding: 8px 12px;
        font-size: 13px;
    }
}
