/* ui-utils.css */

/* Toast Container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 90%;
}

/* Toast Notification */
.toast-notification {
    background-color: #333;
    color: #fff;
    padding: 15px 25px;
    margin-bottom: 10px;
    border-radius: 5px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    align-items: center;
    min-width: 250px;

    /* Ensure content wraps nicely on small screens */
    white-space: pre-wrap;
    word-break: break-word;
}

.toast-notification.show {
    opacity: 1;
}

.toast-notification.success {
    border-left: 5px solid #28a745;
}

.toast-notification.error {
    border-left: 5px solid #dc3545;
}

.toast-notification.warning {
    border-left: 5px solid #ffc107;
    color: #fff;
}

/* Warning text white for contrast */
.toast-notification.info {
    border-left: 5px solid #17a2b8;
}

/* Custom Confirm Modal */

.custom-modal-input {
    width: 100%;
    padding: 10px;
    margin: 15px 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.custom-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    /* Hidden by default */
    justify-content: center;
    align-items: center;
    z-index: 10000;
    /* High z-index to overlay everything including navbar */
    overflow-y: auto;
    /* Enable scroll if modal is too tall */
}

.custom-modal {
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-sizing: border-box;
    /* Changed to border-box for consistent sizing */
}

.custom-modal h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
}

.custom-modal p {
    margin-bottom: 25px;
    color: #666;
}

.custom-modal-actions {
    display: flex;
    justify-content: space-around;
}

.custom-modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background-color 0.2s;
}

.btn-confirm {
    background-color: #28a745;
    color: white;
}

.btn-confirm:hover {
    background-color: #218838;
}

.btn-cancel {
    background-color: #dc3545;
    color: white;
}

.btn-cancel:hover {
    background-color: #c82333;
}

/* Responsive Adjustments */
@media (max-width: 600px) {

    /* Center Toasts on mobile and put them at the top/bottom depending on preference, top is usually safer for web apps to avoid keyboard interference */
    #toast-container {
        top: 10px;
        right: 0;
        left: 0;
        margin: 0 auto;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .toast-notification {
        width: 90%;
        min-width: auto;
        justify-content: center;
        text-align: center;
    }

    .custom-modal {
        width: 95%;
        padding: 20px;
    }

    .custom-modal-actions {
        flex-direction: column;
        /* Stack buttons on very small screens if needed, but side-by-side usually fits */
        gap: 10px;
    }

    .custom-modal-btn {
        width: 100%;
    }
}