/* Custom Modal System - Modern Design */

/* Modal Overlay */
.custom-modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-modal-overlay.active {
    display: flex;
    opacity: 1;
    align-items: center;
    justify-content: center;
}

/* Modal Container */
.custom-modal {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 420px;
    width: 90%;
    max-height: 85vh;
    overflow: hidden;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.custom-modal-overlay.active .custom-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.custom-modal-header {
    padding: 30px 15px 10px 15px;
    text-align: center;
    border-bottom: none;
    background: #ACC6DD;
}

.custom-modal-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2); */
    backdrop-filter: blur(2px);
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.custom-modal-title i {
    font-size: 20px;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2); */
    backdrop-filter: blur(2px);
}

/* Modal Close Button */
.custom-modal-close {
    position: absolute;
    top: 6px;
    right: 10px;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2); */
    backdrop-filter: blur(2px);
    font-size: 14px;
}

.custom-modal-close:hover {
    /* background: #e9ecef; */
    color: #495057;
    transform: scale(1.1);
}

/* Modal Body */
.custom-modal-body {
    padding: 20px 24px 24px 24px;
    text-align: center;
}

.custom-modal-icon {
    width: 60px;
    height: 60px;
    margin: 0 auto 16px;
    background: #5598e9;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px); */
}

.custom-modal-message {
    font-family: 'Montserrat', sans-serif;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
}

.custom-modal-description {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: #6c757d;
    line-height: 1.5;
    margin-bottom: 20px;
}

/* Listing Preview in Modal */
.custom-modal-preview {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 16px;
    margin: 16px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.custom-modal-preview-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
}

.custom-modal-preview-info h6 {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 4px 0;
}

.custom-modal-preview-info p {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

/* Modal Footer */
.custom-modal-footer {
    padding: 0 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

/* Custom Modal Buttons */
.custom-modal-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    min-width: 100px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.custom-modal-btn-secondary {
    background: #6c757d;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px); */
    border: 2px solid #6c757d;
}

.custom-modal-btn-secondary:hover {
    background: #e9ecef;
    color: #495057;
    border-color: #dee2e6;
}

.custom-modal-btn-danger {
    background: #dc3545;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px); */
}

.custom-modal-btn-danger:hover {
    background: #c82333;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.custom-modal-btn-primary {
    background: #5598E9;
    color: #ffffff;
    /* background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(2px); */
}

.custom-modal-btn-primary:hover {
    background: #4084d6;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(85, 152, 233, 0.3);
}

.custom-modal-btn i {
    font-size: 12px;
}

/* Loading State */
.custom-modal-loading {
    opacity: 0.6;
    pointer-events: none;
}

.custom-modal-loading .custom-modal-btn {
    cursor: not-allowed;
}

/* Animation for success/error states */
.custom-modal-success .custom-modal-icon {
    background: rgba(40, 167, 69, 0.1);
    color: #28a745;
}

.custom-modal-success .custom-modal-title i {
    color: #28a745;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .custom-modal {
        max-width: 95%;
        margin: 20px;
        border-radius: 12px;
    }
    
    .custom-modal-header,
    .custom-modal-body,
    .custom-modal-footer {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .custom-modal-footer {
        flex-direction: column;
    }
    
    .custom-modal-btn {
        width: 100%;
    }
    
    .custom-modal-title {
        font-size: 16px;
    }
    
    .custom-modal-message {
        font-size: 15px;
    }
}

/* Smooth animations */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(-30px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.custom-modal-overlay.active .custom-modal {
    animation: modalSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* Form Styles */
.custom-modal-form {
    margin: 20px 0;
    text-align: left;
}

.custom-modal-form-field {
    margin-bottom: 16px;
}

.custom-modal-form-label {
    display: block;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.custom-modal-form-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 14px;
    color: #2c3e50;
    background: #fff;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.custom-modal-form-input:focus {
    outline: none;
    border-color: #5598E9;
    box-shadow: 0 0 0 3px rgba(85, 152, 233, 0.1);
}

.custom-modal-form-input::placeholder {
    color: #6c757d;
    font-style: italic;
}

.custom-modal-form-help {
    display: block;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
    line-height: 1.4;
}

/* Form validation styles */
.custom-modal-form-input:invalid {
    border-color: #5598e9;
}

.custom-modal-form-input:valid {
    border-color:#acc6dd;
}

/* Textarea specific styles */
textarea.custom-modal-form-input {
    resize: vertical;
    min-height: 80px;
}

/* Select specific styles */
select.custom-modal-form-input {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}


