/**
 * CM UI Alerts CSS
 */

/* Toast Container - Holds all toast notifications */
.cm-toast-wrapper {
    position: fixed;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 350px;
    max-width: 90%;
}

/* Toast positioning classes */
.cm-toast-wrapper.top-right {
    top: 50px;
    right: 20px;
}

.cm-toast-wrapper.top-left {
    top: 50px;
    left: 20px;
}

.cm-toast-wrapper.bottom-right {
    bottom: 20px;
    right: 20px;
}

.cm-toast-wrapper.bottom-left {
    bottom: 20px;
    left: 20px;
}

/* Individual toast container */
.cm-toast-container {
    display: flex;
    background-color: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    min-height: 60px;
    max-width: 100%;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s ease;
}

.cm-toast-container.show {
    opacity: 1;
    transform: translateY(0);
}

/* Toast colored edge indicator */
.cm-toast-edge {
    width: 4px;
    flex-shrink: 0;
}

/* Toast type colors - now with cm- prefix */
.cm-toast-edge.cm-success {
    background-color: #28a745;
}

.cm-toast-edge.cm-error {
    background-color: #dc3545;
}

.cm-toast-edge.cm-warning {
    background-color: #ffc107;
}

.cm-toast-edge.cm-info {
    background-color: #17a2b8;
}

/* Toast icon */
.cm-toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    flex-shrink: 0;
    padding: 15px 5px;
}

.cm-toast-icon.cm-success {
    color: #28a745;
}

.cm-toast-icon.cm-error {
    color: #dc3545;
}

.cm-toast-icon.cm-warning {
    color: #ffc107;
}

.cm-toast-icon.cm-info {
    color: #17a2b8;
}

/* Icon symbols */
.cm-toast-icon::before {
    font-family: dashicons;
    font-size: 24px;
}

.cm-toast-icon.cm-success::before {
    content: "\f147"; /* Dashicon: yes */
}

.cm-toast-icon.cm-error::before {
    content: "\f158"; /* Dashicon: dismiss */
}

.cm-toast-icon.cm-warning::before {
    content: "\f534"; /* Dashicon: warning */
}

.cm-toast-icon.cm-info::before {
    content: "\f348"; /* Dashicon: info */
}

/* Toast content area */
.cm-toast-head-n-content {
    flex-grow: 1;
    padding: 15px 10px;
    overflow-wrap: break-word;
    word-break: break-word;
}

.cm-toast-heading {
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
    color: #333;
}

.cm-toast-content {
    font-size: 14px;
    color: #666;
}

/* Toast close button */
.cm-toast-close {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    cursor: pointer;
    font-size: 16px;
    color: #999;
    transition: color 0.2s;
}

.cm-toast-close:hover {
    color: #333;
}

/* Progress bar for auto-dismiss */
.cm-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0, 0, 0, 0.1);
    width: 100%;
}

.cm-toast-progress-bar {
    height: 100%;
    width: 100%;
    transition: width linear;
}

.cm-toast-progress-bar.cm-success {
    background-color: #28a745;
}

.cm-toast-progress-bar.cm-error {
    background-color: #dc3545;
}

.cm-toast-progress-bar.cm-warning {
    background-color: #ffc107;
}

.cm-toast-progress-bar.cm-info {
    background-color: #17a2b8;
}

/* Toast animations */
@keyframes cm-toast-in {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes cm-toast-out {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}

.cm-toast-container.cm-toast-entering {
    animation: cm-toast-in 0.3s ease forwards;
}

.cm-toast-container.cm-toast-exiting {
    animation: cm-toast-out 0.3s ease forwards;
}

/* Ensure proper z-index to appear above WordPress elements */
.cm-toast-wrapper {
    z-index: 99999;
}

/* Modal confirmation buttons */
.cm-modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.cm-button {
    padding: 8px 15px;
    border-radius: 4px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.cm-button-primary {
    background-color: #dc3545;
    color: white;
}

.cm-button-primary:hover {
    background-color: #c82333;
}

.cm-button-secondary {
    background-color: #6c757d;
    color: white;
}

.cm-button-secondary:hover {
    background-color: #5a6268;
}

.cm-modal-content-wrapper {
    margin-bottom: 15px;
}