/**
 * Modal Dialog Animations & Styles
 * CSS สำหรับ Animation ของ Modal Dialog
 * 
 * @version 1.0
 * @date 2025-10-25
 */

/* Animation Classes */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes scaleOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
    to {
        opacity: 0;
        transform: scale(0.9) translateY(-10px);
    }
}

/* Apply Animations */
.animate-fade-in {
    animation: fadeIn 0.2s ease-out forwards;
}

.animate-fade-out {
    animation: fadeOut 0.2s ease-out forwards;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out forwards;
}

.animate-scale-out {
    animation: scaleOut 0.2s ease-out forwards;
}

/* Modal Overlay */
.modal-overlay {
    backdrop-filter: blur(2px);
}

/* Prevent Body Scroll when Modal is Open */
body.modal-open {
    overflow: hidden;
}

/* Custom Scrollbar for Modal Content (if needed) */
.modal-content {
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content::-webkit-scrollbar {
    width: 6px;
}

.modal-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.modal-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Button Hover Effects */
.modal-btn {
    transition: all 0.3s ease;
}

.modal-btn:active {
    transform: scale(0.95) !important;
}

/* Responsive */
@media (max-width: 640px) {
    .modal-content {
        margin: 1rem;
    }
}