/* =========================================================
   WONDER APP — VENDOR APPLICATION
   ALERTS & STATUS MESSAGES
   File: /vendor_app/assets/css/alerts.css
   ========================================================= */


/* =========================================================
   1. BASE ALERT
   ========================================================= */

.alert {
    position: relative;

    display: flex;
    align-items: flex-start;

    width: 100%;

    gap: 12px;

    margin: 0 0 16px;
    padding: 14px 16px;

    color: #374151;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    font-size: 14px;
    line-height: 1.55;

    box-sizing: border-box;
}

.alert:last-child {
    margin-bottom: 0;
}


/* =========================================================
   2. ALERT ICON
   ========================================================= */

.alert-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 22px;
    height: 22px;

    color: currentColor;

    font-size: 16px;
    line-height: 1;
}

.alert-icon svg {
    width: 18px;
    height: 18px;

    fill: currentColor;
}


/* =========================================================
   3. ALERT CONTENT
   ========================================================= */

.alert-content {
    min-width: 0;

    flex: 1;
}

.alert-title {
    margin: 0 0 3px;

    color: currentColor;

    font-size: 14px;
    font-weight: 700;

    line-height: 1.4;
}

.alert-message {
    margin: 0;

    color: inherit;

    font-size: 13px;
    font-weight: 400;

    line-height: 1.55;
}

.alert-message + .alert-message {
    margin-top: 5px;
}


/* =========================================================
   4. ALERT ACTIONS
   ========================================================= */

.alert-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 10px;
}

.alert-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 32px;

    padding: 6px 12px;

    color: currentColor;

    background: transparent;

    border: 1px solid currentColor;
    border-radius: 7px;

    font-size: 12px;
    font-weight: 600;

    text-decoration: none;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        color 0.15s ease,
        border-color 0.15s ease;
}

.alert-action:hover {
    background: rgba(0, 0, 0, 0.05);
}

.alert-action:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}


/* =========================================================
   5. ALERT CLOSE BUTTON
   ========================================================= */

.alert-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 28px;
    height: 28px;

    margin: -3px -3px 0 0;
    padding: 0;

    color: currentColor;

    background: transparent;

    border: 0;
    border-radius: 6px;

    font-size: 18px;
    line-height: 1;

    cursor: pointer;

    opacity: 0.65;

    transition:
        opacity 0.15s ease,
        background-color 0.15s ease;
}

.alert-close:hover {
    opacity: 1;

    background: rgba(0, 0, 0, 0.06);
}

.alert-close:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}


/* =========================================================
   6. INFO ALERT
   ========================================================= */

.alert-info {
    color: #1d4ed8;

    background: #eff6ff;

    border-color: #bfdbfe;
}

.alert-info .alert-icon {
    color: #2563eb;
}


/* =========================================================
   7. SUCCESS ALERT
   ========================================================= */

.alert-success {
    color: #15803d;

    background: #f0fdf4;

    border-color: #bbf7d0;
}

.alert-success .alert-icon {
    color: #16a34a;
}


/* =========================================================
   8. WARNING ALERT
   ========================================================= */

.alert-warning {
    color: #b45309;

    background: #fffbeb;

    border-color: #fde68a;
}

.alert-warning .alert-icon {
    color: #d97706;
}


/* =========================================================
   9. DANGER / ERROR ALERT
   ========================================================= */

.alert-danger,
.alert-error {
    color: #b91c1c;

    background: #fef2f2;

    border-color: #fecaca;
}

.alert-danger .alert-icon,
.alert-error .alert-icon {
    color: #dc2626;
}


/* =========================================================
   10. NEUTRAL ALERT
   ========================================================= */

.alert-neutral {
    color: #374151;

    background: #f9fafb;

    border-color: #e5e7eb;
}

.alert-neutral .alert-icon {
    color: #6b7280;
}


/* =========================================================
   11. PRIMARY ALERT
   ========================================================= */

.alert-primary {
    color: #1e40af;

    background: #eff6ff;

    border-color: #bfdbfe;
}

.alert-primary .alert-icon {
    color: #2563eb;
}


/* =========================================================
   12. LIGHT ALERT
   ========================================================= */

.alert-light {
    color: #374151;

    background: #ffffff;

    border-color: #e5e7eb;
}


/* =========================================================
   13. DARK ALERT
   ========================================================= */

.alert-dark {
    color: #f9fafb;

    background: #1f2937;

    border-color: #374151;
}

.alert-dark .alert-icon {
    color: #d1d5db;
}


/* =========================================================
   14. ALERT WITH LEFT ACCENT
   ========================================================= */

.alert-accent {
    border-left-width: 4px;
}

.alert-info.alert-accent {
    border-left-color: #2563eb;
}

.alert-success.alert-accent {
    border-left-color: #16a34a;
}

.alert-warning.alert-accent {
    border-left-color: #d97706;
}

.alert-danger.alert-accent,
.alert-error.alert-accent {
    border-left-color: #dc2626;
}


/* =========================================================
   15. COMPACT ALERT
   ========================================================= */

.alert-compact {
    padding: 10px 12px;

    gap: 9px;

    border-radius: 8px;

    font-size: 13px;
}

.alert-compact .alert-icon {
    width: 18px;
    height: 18px;

    font-size: 14px;
}

.alert-compact .alert-title {
    font-size: 13px;
}

.alert-compact .alert-message {
    font-size: 12px;
}

.alert-compact .alert-close {
    width: 24px;
    height: 24px;

    font-size: 16px;
}


/* =========================================================
   16. LARGE ALERT
   ========================================================= */

.alert-lg {
    padding: 18px 20px;

    gap: 14px;

    border-radius: 12px;
}

.alert-lg .alert-icon {
    width: 26px;
    height: 26px;

    font-size: 19px;
}

.alert-lg .alert-title {
    font-size: 15px;
}

.alert-lg .alert-message {
    font-size: 14px;
}


/* =========================================================
   17. FULL WIDTH ALERT
   ========================================================= */

.alert-full {
    width: 100%;
}


/* =========================================================
   18. INLINE ALERT
   ========================================================= */

.alert-inline {
    display: inline-flex;

    width: auto;

    margin-bottom: 0;
}


/* =========================================================
   19. FORM VALIDATION ALERT
   ========================================================= */

.form-alert {
    display: flex;
    align-items: flex-start;

    gap: 8px;

    margin-top: 8px;

    color: #b91c1c;

    font-size: 12px;
    line-height: 1.5;
}

.form-alert-icon {
    flex: 0 0 auto;

    margin-top: 1px;

    font-size: 12px;
}

.form-alert-message {
    min-width: 0;
}


/* =========================================================
   20. FORM FIELD ERROR
   ========================================================= */

.form-error {
    color: #b91c1c;
}

.form-error .form-control,
.form-error input,
.form-error select,
.form-error textarea {
    border-color: #ef4444;
}

.form-error .form-control:focus,
.form-error input:focus,
.form-error select:focus,
.form-error textarea:focus {
    border-color: #dc2626;

    box-shadow:
        0 0 0 3px rgba(220, 38, 38, 0.12);
}


/* =========================================================
   21. FORM FIELD SUCCESS
   ========================================================= */

.form-success {
    color: #15803d;
}

.form-success .form-control,
.form-success input,
.form-success select,
.form-success textarea {
    border-color: #22c55e;
}

.form-success .form-control:focus,
.form-success input:focus,
.form-success select:focus,
.form-success textarea:focus {
    border-color: #16a34a;

    box-shadow:
        0 0 0 3px rgba(22, 163, 74, 0.12);
}


/* =========================================================
   22. API / DASHBOARD ERROR
   ========================================================= */

.dashboard-alert {
    width: 100%;

    margin-bottom: 20px;
}

.dashboard-alert .alert {
    margin-bottom: 0;
}


/* =========================================================
   23. PAGE ERROR STATE
   ========================================================= */

.page-error {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 180px;

    padding: 30px;

    text-align: center;
}

.page-error-content {
    max-width: 460px;
}

.page-error-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 52px;
    height: 52px;

    margin: 0 auto 14px;

    color: #dc2626;

    background: #fef2f2;

    border-radius: 50%;

    font-size: 24px;
}

.page-error-title {
    margin: 0;

    color: #111827;

    font-size: 17px;
    font-weight: 700;
}

.page-error-message {
    margin: 7px 0 0;

    color: #6b7280;

    font-size: 13px;

    line-height: 1.6;
}

.page-error-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;

    gap: 8px;

    margin-top: 16px;
}


/* =========================================================
   24. API ERROR BOX
   ========================================================= */

.api-error {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 14px 16px;

    color: #991b1b;

    background: #fef2f2;

    border: 1px solid #fecaca;
    border-radius: 10px;
}

.api-error-title {
    margin: 0 0 3px;

    font-size: 14px;
    font-weight: 700;
}

.api-error-message {
    margin: 0;

    color: #b91c1c;

    font-size: 13px;
    line-height: 1.5;
}

.api-error-code {
    display: inline-block;

    margin-top: 6px;

    padding: 2px 6px;

    color: #991b1b;

    background: #fee2e2;

    border-radius: 4px;

    font-family: monospace;

    font-size: 11px;
}


/* =========================================================
   25. SUCCESS MESSAGE
   ========================================================= */

.success-message {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 12px 14px;

    color: #15803d;

    background: #f0fdf4;

    border: 1px solid #bbf7d0;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   26. WARNING MESSAGE
   ========================================================= */

.warning-message {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 12px 14px;

    color: #b45309;

    background: #fffbeb;

    border: 1px solid #fde68a;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   27. INFO MESSAGE
   ========================================================= */

.info-message {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 12px 14px;

    color: #1d4ed8;

    background: #eff6ff;

    border: 1px solid #bfdbfe;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   28. ERROR MESSAGE
   ========================================================= */

.error-message {
    display: flex;
    align-items: flex-start;

    gap: 10px;

    padding: 12px 14px;

    color: #b91c1c;

    background: #fef2f2;

    border: 1px solid #fecaca;
    border-radius: 8px;

    font-size: 13px;
    line-height: 1.5;
}


/* =========================================================
   29. ALERT LIST
   ========================================================= */

.alert-list {
    display: flex;
    flex-direction: column;

    gap: 10px;

    margin: 0;
    padding: 0;

    list-style: none;
}

.alert-list .alert {
    margin-bottom: 0;
}


/* =========================================================
   30. MULTI-LINE ERROR LIST
   ========================================================= */

.alert-errors {
    margin: 8px 0 0;
    padding-left: 18px;

    color: inherit;

    font-size: 13px;
}

.alert-errors li {
    margin-bottom: 4px;
}

.alert-errors li:last-child {
    margin-bottom: 0;
}


/* =========================================================
   31. STATUS BANNER
   ========================================================= */

.status-banner {
    display: flex;
    align-items: center;

    gap: 12px;

    width: 100%;

    min-height: 48px;

    padding: 10px 16px;

    color: #374151;

    background: #f9fafb;

    border-bottom: 1px solid #e5e7eb;
}

.status-banner-content {
    flex: 1;
    min-width: 0;
}

.status-banner-title {
    margin: 0;

    font-size: 13px;
    font-weight: 700;
}

.status-banner-message {
    margin: 2px 0 0;

    color: #6b7280;

    font-size: 12px;
}

.status-banner-info {
    color: #1d4ed8;
    background: #eff6ff;
    border-color: #bfdbfe;
}

.status-banner-success {
    color: #15803d;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.status-banner-warning {
    color: #b45309;
    background: #fffbeb;
    border-color: #fde68a;
}

.status-banner-danger {
    color: #b91c1c;
    background: #fef2f2;
    border-color: #fecaca;
}


/* =========================================================
   32. DISMISSIBLE ALERT
   ========================================================= */

.alert-dismissible {
    padding-right: 48px;
}

.alert-dismissible .alert-close {
    position: absolute;

    top: 12px;
    right: 12px;
}


/* =========================================================
   33. ALERT ENTER / EXIT ANIMATION
   ========================================================= */

.alert.is-entering {
    animation: alert-enter 0.2s ease forwards;
}

.alert.is-leaving {
    animation: alert-leave 0.2s ease forwards;
}

@keyframes alert-enter {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes alert-leave {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}


/* =========================================================
   34. TOAST BASE
   ========================================================= */

.toast {
    position: relative;

    display: flex;
    align-items: flex-start;

    gap: 10px;

    width: min(380px, calc(100vw - 32px));

    padding: 13px 14px;

    color: #374151;

    background: #ffffff;

    border: 1px solid #e5e7eb;
    border-radius: 10px;

    box-shadow:
        0 10px 30px rgba(15, 23, 42, 0.12),
        0 2px 8px rgba(15, 23, 42, 0.06);

    font-size: 13px;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    margin: 0 0 2px;

    color: #111827;

    font-size: 13px;
    font-weight: 700;
}

.toast-message {
    margin: 0;

    color: #6b7280;

    font-size: 12px;
    line-height: 1.5;
}

.toast-success {
    border-left: 3px solid #16a34a;
}

.toast-error,
.toast-danger {
    border-left: 3px solid #dc2626;
}

.toast-warning {
    border-left: 3px solid #d97706;
}

.toast-info {
    border-left: 3px solid #2563eb;
}


/* =========================================================
   35. TOAST CONTAINER
   ========================================================= */

.toast-container {
    position: fixed;

    z-index: 3000;

    display: flex;
    flex-direction: column;

    gap: 10px;

    width: auto;

    pointer-events: none;
}

.toast-container .toast {
    pointer-events: auto;
}


/* Top Right */

.toast-container.toast-top-right {
    top: 20px;
    right: 20px;

    align-items: flex-end;
}


/* Top Left */

.toast-container.toast-top-left {
    top: 20px;
    left: 20px;

    align-items: flex-start;
}


/* Bottom Right */

.toast-container.toast-bottom-right {
    right: 20px;
    bottom: 20px;

    align-items: flex-end;
}


/* Bottom Left */

.toast-container.toast-bottom-left {
    bottom: 20px;
    left: 20px;

    align-items: flex-start;
}


/* Bottom Center */

.toast-container.toast-bottom-center {
    bottom: 20px;
    left: 50%;

    align-items: center;

    transform: translateX(-50%);
}


/* =========================================================
   36. SYSTEM / MAINTENANCE ALERT
   ========================================================= */

.system-alert {
    display: flex;
    align-items: center;

    gap: 12px;

    padding: 12px 16px;

    color: #ffffff;

    background: #1f2937;

    font-size: 13px;

    line-height: 1.5;
}

.system-alert-content {
    flex: 1;
}

.system-alert-title {
    margin: 0;

    font-weight: 700;
}

.system-alert-message {
    margin: 2px 0 0;

    opacity: 0.85;
}

.system-alert .alert-close {
    color: #ffffff;
}


/* =========================================================
   37. SECURITY ALERT
   ========================================================= */

.security-alert {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 14px 16px;

    color: #991b1b;

    background: #fff1f2;

    border: 1px solid #fecdd3;
    border-radius: 10px;
}

.security-alert .security-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 30px;
    height: 30px;

    color: #dc2626;

    background: #fee2e2;

    border-radius: 50%;
}

.security-alert-title {
    margin: 0 0 3px;

    color: #991b1b;

    font-size: 14px;
    font-weight: 700;
}

.security-alert-message {
    margin: 0;

    color: #b91c1c;

    font-size: 13px;

    line-height: 1.5;
}


/* =========================================================
   38. VERIFICATION ALERT
   ========================================================= */

.verification-alert {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 14px 16px;

    color: #92400e;

    background: #fffbeb;

    border: 1px solid #fde68a;
    border-radius: 10px;
}

.verification-alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 auto;

    width: 30px;
    height: 30px;

    color: #d97706;

    background: #fef3c7;

    border-radius: 50%;
}

.verification-alert-title {
    margin: 0 0 3px;

    color: #92400e;

    font-size: 14px;
    font-weight: 700;
}

.verification-alert-message {
    margin: 0;

    color: #a16207;

    font-size: 13px;

    line-height: 1.5;
}


/* =========================================================
   39. BILLING ALERT
   ========================================================= */

.billing-alert {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 14px 16px;

    color: #7c2d12;

    background: #fff7ed;

    border: 1px solid #fed7aa;
    border-radius: 10px;
}

.billing-alert-icon {
    flex: 0 0 auto;

    color: #ea580c;

    font-size: 20px;
}

.billing-alert-title {
    margin: 0 0 3px;

    color: #9a3412;

    font-size: 14px;
    font-weight: 700;
}

.billing-alert-message {
    margin: 0;

    color: #c2410c;

    font-size: 13px;

    line-height: 1.5;
}


/* =========================================================
   40. OFFLINE ALERT
   ========================================================= */

.offline-alert {
    position: fixed;

    top: 0;
    left: 0;

    z-index: 4000;

    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;

    min-height: 42px;

    padding: 8px 16px;

    color: #ffffff;

    background: #374151;

    font-size: 13px;

    text-align: center;
}

.offline-alert-message {
    margin: 0;
}

.offline-alert.is-hidden {
    display: none;
}


/* =========================================================
   41. ALERT RESPONSIVE
   ========================================================= */

@media (max-width: 767px) {

    .alert {
        padding: 12px 13px;

        gap: 9px;

        border-radius: 8px;
    }

    .alert-title {
        font-size: 13px;
    }

    .alert-message {
        font-size: 12px;
    }

    .alert-actions {
        width: 100%;
    }

    .alert-action {
        min-height: 30px;

        padding: 5px 10px;

        font-size: 11px;
    }

    .alert-lg {
        padding: 15px;
    }

    .toast-container {
        top: auto !important;
        right: 0 !important;
        bottom: 12px !important;
        left: 0 !important;

        width: 100%;

        padding: 0 16px;

        align-items: stretch !important;

        transform: none !important;
    }

    .toast {
        width: 100%;
    }

    .system-alert,
    .security-alert,
    .verification-alert,
    .billing-alert {
        padding: 12px 13px;
    }
}


/* =========================================================
   42. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .alert,
    .alert-action,
    .alert-close {
        transition: none;
    }

    .alert.is-entering,
    .alert.is-leaving {
        animation: none;
    }
}


/* =========================================================
   43. PRINT
   ========================================================= */

@media print {

    .alert,
    .api-error,
    .success-message,
    .warning-message,
    .info-message,
    .error-message,
    .security-alert,
    .verification-alert,
    .billing-alert,
    .offline-alert,
    .toast-container {
        box-shadow: none !important;
    }

    .toast-container,
    .offline-alert {
        display: none !important;
    }
}