/* Base alert styling */
.alert {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 400px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 24px;
    text-align: center;
    display: none;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Alert title */
.alert .alert-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: #333;
}

/* Alert text */
.alert .alert-text {
    font-size: 16px;
    color: #666;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* Alert buttons container */
.alert .alert-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 20px;
}

/* Alert button */
.alert .alert-btn {
    display: inline-block;
    padding: 10px 24px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #f8f9fa;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 80px;
}

.alert .alert-btn:hover {
    background-color: #e9ecef;
}

/* Confirm button (primary action) */
.alert .alert-confirm {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.alert .alert-confirm:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* OK button */
.alert .alert-ok {
    background-color: #007bff;
    border-color: #007bff;
    color: #fff;
}

.alert .alert-ok:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

/* Cancel button */
.alert .alert-cancel {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.alert .alert-cancel:hover {
    background-color: #5a6268;
    border-color: #5a6268;
}

/* Prompt input field */
.alert .alert-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    margin-top: 12px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.alert .alert-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* Alert types */
.alert.rsl-alert-success {
    border-top: 4px solid #28a745;
}

.alert.rsl-alert-success .alert-title {
    color: #28a745;
}

.alert.rsl-alert-danger,
.alert.rsl-alert-error {
    border-top: 4px solid #dc3545;
}

.alert.rsl-alert-danger .alert-title,
.alert.rsl-alert-error .alert-title {
    color: #dc3545;
}

.alert.rsl-alert-warning {
    border-top: 4px solid #ffc107;
}

.alert.rsl-alert-warning .alert-title {
    color: #d39e00;
}

.alert.rsl-alert-info {
    border-top: 4px solid #17a2b8;
}

.alert.rsl-alert-info .alert-title {
    color: #17a2b8;
}

/* Alert positions */
.alert.rsl-alert-top {
    top: 20%;
    transform: translate(-50%, 0);
}

.alert.rsl-alert-bottom {
    top: auto;
    bottom: 20%;
    transform: translate(-50%, 0);
}

.alert.rsl-alert-center {
    /* Default center position */
}

/* Animations */
.alert.slide-down {
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    0% {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.alert.slide-up {
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -40%);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

.alert.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
    }
    100% {
        opacity: 1;
    }
}

.alert.zoom-in {
    animation: zoomIn 0.3s ease-out;
}

@keyframes zoomIn {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.5);
    }
    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

/* Overlay */
.rsl-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .alert {
        width: 95%;
        padding: 20px;
    }

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

    .alert .alert-text {
        font-size: 14px;
    }

    .alert .alert-buttons {
        flex-direction: column;
    }

    .alert .alert-btn {
        width: 100%;
    }
}

/* Dark mode support */
[data-theme="dark"] .alert {
    background-color: #1a1a1a;
    border: 1px solid #333;
}

[data-theme="dark"] .alert .alert-title {
    color: #e0e0e0;
}

/* Dark mode - preserve semantic type colors */
[data-theme="dark"] .alert.rsl-alert-success {
    border-top: 4px solid #28a745;
}

[data-theme="dark"] .alert.rsl-alert-success .alert-title {
    color: #4ade80;
}

[data-theme="dark"] .alert.rsl-alert-danger,
[data-theme="dark"] .alert.rsl-alert-error {
    border-top: 4px solid #dc3545;
}

[data-theme="dark"] .alert.rsl-alert-danger .alert-title,
[data-theme="dark"] .alert.rsl-alert-error .alert-title {
    color: #f87171;
}

[data-theme="dark"] .alert.rsl-alert-warning {
    border-top: 4px solid #ffc107;
}

[data-theme="dark"] .alert.rsl-alert-warning .alert-title {
    color: #fbbf24;
}

[data-theme="dark"] .alert.rsl-alert-info {
    border-top: 4px solid #17a2b8;
}

[data-theme="dark"] .alert.rsl-alert-info .alert-title {
    color: #38bdf8;
}

[data-theme="dark"] .alert .alert-text {
    color: #b0b0b0;
}

[data-theme="dark"] .alert .alert-input {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .alert .alert-input:focus {
    border-color: #4a9eff;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

[data-theme="dark"] .alert .alert-btn {
    background-color: #2a2a2a;
    border-color: #444;
    color: #e0e0e0;
}

[data-theme="dark"] .alert .alert-btn:hover {
    background-color: #333;
}

[data-theme="dark"] .alert .alert-confirm,
[data-theme="dark"] .alert .alert-ok {
    background-color: #4a9eff;
    border-color: #4a9eff;
    color: #1a1a1a;
}

[data-theme="dark"] .alert .alert-confirm:hover,
[data-theme="dark"] .alert .alert-ok:hover {
    background-color: #3a8eef;
    border-color: #3a8eef;
}

[data-theme="dark"] .alert .alert-cancel {
    background-color: #555;
    border-color: #555;
    color: #e0e0e0;
}

[data-theme="dark"] .alert .alert-cancel:hover {
    background-color: #666;
    border-color: #666;
}