/* Styled Popup System - Replaces JavaScript alerts */

/* Overlay that covers the entire screen */
.whiz-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.whiz-popup-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Main popup container */
.whiz-popup {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    transform: scale(0.7);
    transition: transform 0.3s ease;
}

.whiz-popup-overlay.show .whiz-popup {
    transform: scale(1);
}

/* Popup header */
.whiz-popup-header {
    padding: 20px 20px 10px 20px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.whiz-popup-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.whiz-popup-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.whiz-popup-close:hover {
    background-color: #f0f0f0;
    color: #666;
}

/* Popup content */
.whiz-popup-content {
    padding: 20px;
}

.whiz-popup-message {
    margin: 0 0 20px 0;
    line-height: 1.5;
    color: #555;
    font-size: 14px;
}

/* Popup types */
.whiz-popup.error .whiz-popup-header {
    border-bottom-color: #dc3545;
}

.whiz-popup.error .whiz-popup-title {
    color: #dc3545;
}

.whiz-popup.success .whiz-popup-header {
    border-bottom-color: #28a745;
}

.whiz-popup.success .whiz-popup-title {
    color: #28a745;
}

.whiz-popup.warning .whiz-popup-header {
    border-bottom-color: #ffc107;
}

.whiz-popup.warning .whiz-popup-title {
    color: #856404;
}

.whiz-popup.info .whiz-popup-header {
    border-bottom-color: #17a2b8;
}

.whiz-popup.info .whiz-popup-title {
    color: #17a2b8;
}

/* Popup buttons */
.whiz-popup-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.whiz-popup-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease, transform 0.1s ease;
    min-width: 80px;
}

.whiz-popup-button:hover {
    transform: translateY(-1px);
}

.whiz-popup-button:active {
    transform: translateY(0);
}

.whiz-popup-button.primary {
    background-color: #007cba;
    color: white;
}

.whiz-popup-button.primary:hover {
    background-color: #005a87;
}

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

.whiz-popup-button.secondary:hover {
    background-color: #545b62;
}

.whiz-popup-button.danger {
    background-color: #dc3545;
    color: white;
}

.whiz-popup-button.danger:hover {
    background-color: #c82333;
}

/* Icon styles */
.whiz-popup-icon {
    margin-right: 10px;
    font-size: 20px;
}

.whiz-popup.error .whiz-popup-icon::before {
    content: "⚠️";
}

.whiz-popup.success .whiz-popup-icon::before {
    content: "✅";
}

.whiz-popup.warning .whiz-popup-icon::before {
    content: "⚠️";
}

.whiz-popup.info .whiz-popup-icon::before {
    content: "ℹ️";
}

/* Responsive design */
@media (max-width: 600px) {
    .whiz-popup {
        width: 95%;
        margin: 20px;
    }
    
    .whiz-popup-buttons {
        flex-direction: column;
    }
    
    .whiz-popup-button {
        width: 100%;
    }
}

/* Animation for entrance */
@keyframes whizPopupSlideIn {
    from {
        transform: translateY(-50px) scale(0.9);
        opacity: 0;
    }
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

.whiz-popup-overlay.show .whiz-popup {
    animation: whizPopupSlideIn 0.3s ease-out;
}