/**
 * Alert/Toast System Styles
 */

/* Alert container */
.alert-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 420px;
    pointer-events: none;
}

@media (max-width: 768px) {
    .alert-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
}

/* Individual alert */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideInRight 0.3s ease-out;
    pointer-events: auto;
    border-left: 4px solid;
    font-size: 14px;
    line-height: 1.5;
}

/* Success alert */
.alert-success {
    background-color: rgba(56, 161, 105, 0.15);
    border-color: #38a169;
    color: #68d391;
}

[data-theme="light"] .alert-success {
    background-color: rgba(22, 163, 74, 0.1);
    border-color: #16a34a;
    color: #16a34a;
}

/* Error alert */
.alert-error {
    background-color: rgba(229, 62, 62, 0.15);
    border-color: #e53e3e;
    color: #fc8181;
}

[data-theme="light"] .alert-error {
    background-color: rgba(220, 38, 38, 0.1);
    border-color: #dc2626;
    color: #dc2626;
}

/* Warning alert */
.alert-warning {
    background-color: rgba(245, 158, 11, 0.15);
    border-color: #f59e0b;
    color: #fcd34d;
}

[data-theme="light"] .alert-warning {
    background-color: rgba(217, 119, 6, 0.1);
    border-color: #d97706;
    color: #d97706;
}

/* Info alert */
.alert-info {
    background-color: rgba(59, 130, 246, 0.15);
    border-color: #3b82f6;
    color: #93c5fd;
}

[data-theme="light"] .alert-info {
    background-color: rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
    color: #2563eb;
}

/* Alert icon */
.alert-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    font-size: 18px;
    font-weight: bold;
}

/* Alert message */
.alert-message {
    flex: 1;
    word-break: break-word;
}

/* Alert close button */
.alert-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.7;
}

.alert-close:hover {
    opacity: 1;
    background-color: rgba(0, 0, 0, 0.1);
}

/* Animations */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Remove animation */
.alert.removing {
    animation: slideOutRight 0.3s ease-out forwards;
}

/* Alert list styles for multiple items */
.alert ul {
    margin: 0;
    padding-left: 20px;
}

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

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

/* Bold text in alerts */
.alert strong {
    font-weight: 600;
}

/* Link styling in alerts */
.alert a {
    color: inherit;
    text-decoration: underline;
    opacity: 0.9;
}

.alert a:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .alert {
        font-size: 13px;
        padding: 12px 14px;
        gap: 10px;
    }

    .alert-icon {
        min-width: 20px;
        height: 20px;
        font-size: 16px;
    }

    .alert-close {
        width: 20px;
        height: 20px;
        font-size: 18px;
    }
}

/* Accessibility - Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .alert {
        animation: none;
    }

    .alert.removing {
        animation: none;
    }

    .alert-close {
        transition: none;
    }
}

/* Dark mode enhancements */
@media (prefers-color-scheme: dark) {
    .alert {
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
}

/* Status alert in forms */
.form-status-alert {
    margin-bottom: 24px;
}

.form-status-alert.hidden {
    display: none;
}

/* Multiple alerts stacking */
.alert-container .alert + .alert {
    animation-delay: 0.1s;
}

/* Alert with custom styling */
.alert.custom {
    background-color: var(--custom-bg, rgba(168, 127, 255, 0.15));
    border-color: var(--custom-border, rgba(168, 127, 255, 0.3));
    color: var(--custom-text, #a87fff);
}
