/* Resend Email Feature Styles */

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 9999; /* Increased z-index to ensure it appears on top */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling of background */
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
    visibility: visible;
    opacity: 1;
    pointer-events: auto; /* Ensure the modal captures all pointer events */
}

/* Explicitly show the resend email popup when it's active */
#resend-email-popup.active {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure modal is visible and captures all events */
#resend-email-popup {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    pointer-events: all !important; /* Force capturing all mouse events */
}

/* Ensure modal body properly handles content */
.modal-body {
    padding: 20px;
    max-height: 50vh; /* Limit height to prevent overflow */
    overflow-y: auto; /* Allow vertical scrolling */
}

/* Ensure participants list is scrollable */
.participants-list {
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 10% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease;
    overflow: auto; /* Allow scrolling within the modal content */
    max-height: 80vh; /* Limit height to 80% of viewport height */
    pointer-events: auto; /* Ensure clicks are captured */
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    pointer-events: auto; /* Ensure clicks are captured */
}

.modal-header h3 {
    margin: 0;
    color: var(--primary-color);
}

.close-modal {
    color: var(--grey-500);
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition);
    pointer-events: auto; /* Ensure clicks are captured */
    z-index: 10000; /* Higher z-index than parent */
}

.close-modal:hover {
    color: var(--primary-color);
}

/* Modal footer styles */
.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    pointer-events: auto; /* Ensure clicks are captured */
}

/* Participant item styles */
.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 5px;
    background-color: #f9f9f9;
    border-radius: 4px;
    pointer-events: auto; /* Ensure clicks are captured */
}

.remove-participant-btn {
    color: #ff5555;
    cursor: pointer;
    font-weight: bold;
    font-size: 18px;
    pointer-events: auto; /* Ensure clicks are captured */
    z-index: 10000; /* Higher z-index than parent */
}

.remove-participant-btn:hover {
    color: #ff0000;
}

/* Add participant form styles */
.add-participant-form {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    pointer-events: auto; /* Ensure clicks are captured */
}

.add-participant-form input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    pointer-events: auto; /* Ensure clicks are captured */
}

.modal-body {
    padding: 20px;
}

.modal-footer {
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Participants container styles */
.participants-container {
    margin-top: 15px;
}

.participants-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 15px;
    padding: 10px;
}

.participant-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin-bottom: 5px;
    background-color: var(--grey-100);
    border-radius: 4px;
}

.participant-item:last-child {
    margin-bottom: 0;
}

.participant-item span {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.remove-participant-btn {
    background: none;
    border: none;
    color: var(--grey-500);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.remove-participant-btn:hover {
    color: var(--danger-color);
}

.add-participant-form {
    display: flex;
    gap: 10px;
}

.add-participant-form input {
    flex: 1;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.empty-state {
    padding: 20px;
    text-align: center;
    color: var(--grey-500);
}

.loading {
    padding: 20px;
    text-align: center;
    color: var(--grey-500);
}

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

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Responsive styles */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .add-participant-form {
        flex-direction: column;
    }
}

/* Resend Email Button */
#resend-email-btn {
    margin-left: 10px;
}
