/**
 * Custom Alert System Styles
 * สไตล์สำหรับระบบแจ้งเตือนแบบกำหนดเอง
 */

/* Container */
#customAlertContainer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
}

/* Alert Overlay */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: all;
    z-index: 10000;
}

.custom-alert-overlay.show {
    opacity: 1;
}

/* Alert Box */
.custom-alert-box {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.7);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    text-align: center;
}

.custom-alert-overlay.show .custom-alert-box {
    transform: scale(1);
}

/* Alert Icon */
.custom-alert-icon {
    margin-bottom: 20px;
    animation: iconBounce 0.6s ease;
}

@keyframes iconBounce {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Alert Message */
.custom-alert-message {
    font-size: 1.15rem;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.6;
    white-space: pre-line;
}

/* Alert Buttons */
.custom-alert-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.custom-alert-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.custom-alert-btn-primary {
    background: linear-gradient(135deg, #4e73df, #224abe);
    color: white;
}

.custom-alert-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(78, 115, 223, 0.4);
}

.custom-alert-btn-secondary {
    background: #6c757d;
    color: white;
}

.custom-alert-btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

.custom-alert-btn:active {
    transform: translateY(0);
}

/* Toast Notifications */
.custom-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 12px;
    padding: 16px 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 300px;
    max-width: 500px;
    transform: translateX(120%);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: all;
    z-index: 10001;
    margin-bottom: 10px;
}

.custom-toast.show {
    transform: translateX(0);
}

.custom-toast-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.custom-toast-success {
    border-left: 4px solid #28a745;
}

.custom-toast-success .custom-toast-icon {
    color: #28a745;
}

.custom-toast-error {
    border-left: 4px solid #dc3545;
}

.custom-toast-error .custom-toast-icon {
    color: #dc3545;
}

.custom-toast-warning {
    border-left: 4px solid #ffc107;
}

.custom-toast-warning .custom-toast-icon {
    color: #ffc107;
}

.custom-toast-info {
    border-left: 4px solid #17a2b8;
}

.custom-toast-info .custom-toast-icon {
    color: #17a2b8;
}

.custom-toast-message {
    flex: 1;
    font-size: 0.95rem;
    color: #333;
    line-height: 1.4;
}

.custom-toast-close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    font-size: 1rem;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.custom-toast-close:hover {
    color: #333;
}

/* Responsive */
@media (max-width: 576px) {
    .custom-alert-box {
        padding: 30px 20px;
        width: 95%;
    }
    
    .custom-alert-message {
        font-size: 1rem;
    }
    
    .custom-alert-buttons {
        flex-direction: column;
    }
    
    .custom-alert-btn {
        width: 100%;
    }
    
    .custom-toast {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }
}

/* Animation for multiple toasts */
.custom-toast:nth-child(2) {
    top: 90px;
}

.custom-toast:nth-child(3) {
    top: 160px;
}

.custom-toast:nth-child(4) {
    top: 230px;
}

/* Loading Spinner (optional) */
.custom-alert-loading {
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4e73df;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
