/**
 * UM Modal Styles
 * 
 * Modal popup styling with um- prefixed classes
 * Based on Micromodal.js structure
 * 
 * @package BananaProperty\UsersManagement
 * @since 1.0.0
 */

/* Modal Container - Hidden by default */
.um-modal {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 999999 !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Modal visible state - becomes fixed overlay */
.um-modal.um-modal--open {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    pointer-events: auto !important;
    animation: um-modal-fade-in 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* Modal Overlay - The actual backdrop/overlay layer */
.um-modal__overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 999999 !important;
    backdrop-filter: blur(2px);
}

/* Modal Container */
.um-modal__container {
    background-color: #ffffff;
    padding: 0;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    animation: um-modal-slide-in 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
}

/* Modal Header */
.um-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
}

.um-modal__title {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

/* Modal Close Button */
.um-modal__close {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.um-modal__close:hover {
    background-color: #f3f4f6;
}

.um-modal__close svg {
    width: 24px;
    height: 24px;
    stroke: #6b7280;
}

/* Modal Content */
.um-modal__content {
    padding: 24px;
}

/* Animations */
@keyframes um-modal-fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes um-modal-slide-in {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Prevent body scroll when modal is open */
body.um-modal-open {
    overflow: hidden;
}

/* Responsive - Full screen on mobile */
@media (max-width: 768px) {
    .um-modal__overlay {
        align-items: stretch !important;
        padding: 0 !important;
    }
    
    .um-modal__container {
        max-width: 100% !important;
        width: 100% !important;
        max-height: 100vh !important;
        height: 100vh !important;
        border-radius: 0 !important;
        margin: 0 !important;
        animation: um-modal-slide-up 0.3s cubic-bezier(0.0, 0.0, 0.2, 1);
    }
    
    .um-modal__header {
        padding: 20px 20px 12px;
    }
    
    .um-modal__title {
        font-size: 20px;
    }
    
    .um-modal__content {
        padding: 20px;
        height: calc(100vh - 70px);
        overflow-y: auto;
    }
}

/* Mobile slide-up animation */
@keyframes um-modal-slide-up {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Accessibility: Focus styles */
.um-modal__container:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}


/* Smooth scrolling for modal content */
.um-modal__container {
    scroll-behavior: smooth;
}

/* Custom scrollbar for modal (WebKit browsers) */
.um-modal__container::-webkit-scrollbar {
    width: 8px;
}

.um-modal__container::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.um-modal__container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.um-modal__container::-webkit-scrollbar-thumb:hover {
    background: #555;
}
