/* 
 * Generic Modal Component Styles
 * Reusable modal popup system for the application
 */

/* Modal overlay */
.modal-overlay {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    animation: modalFadeIn 0.15s ease-out;
}

.modal-overlay.visible {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Modal container */
.modal-container {
    background-color: #fefefe;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.24);
    max-width: 400px;
    width: 90%;
    animation: modalSlideIn 0.2s ease-out;
    overflow: hidden;
}

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

/* Modal header */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background-color: #1e5925;
    color: white;
}

.modal-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.modal-close-btn {
    background: transparent;
    border: none;
    color: white;
    font-size: 22px;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.15s;
    opacity: 0.8;
}

.modal-close-btn:hover {
    background-color: rgba(255, 255, 255, 0.15);
    opacity: 1;
}

/* Modal body */
.modal-body {
    padding: 24px 20px;
}

.modal-message {
    margin: 0 0 16px 0;
    font-size: 14px;
    color: #333;
    line-height: 1.5;
}

/* Input field styling */
.modal-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.modal-input:focus {
    outline: none;
    border-color: #1e5925;
    box-shadow: 0 0 0 3px rgba(30, 89, 37, 0.12);
}

.modal-input::placeholder {
    color: #999;
}

/* Modal footer */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 20px;
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
}

/* Button styles */
.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.15s, transform 0.1s;
    min-width: 80px;
}

.modal-btn:active {
    transform: scale(0.98);
}

.modal-btn-primary {
    background-color: #1e5925;
    color: white;
}

.modal-btn-primary:hover {
    background-color: #2a7a35;
}

.modal-btn-primary:disabled {
    background-color: #888;
    cursor: not-allowed;
}

.modal-btn-secondary {
    background-color: #6b7280;
    color: white;
}

.modal-btn-secondary:hover {
    background-color: #5a6370;
}

.modal-btn-danger {
    background-color: #dc3545;
    color: white;
}

.modal-btn-danger:hover {
    background-color: #c82333;
}

/* Confirmation modal specific styles */
.modal-container.modal-confirm .modal-body {
    text-align: center;
    padding: 28px 24px;
}

.modal-container.modal-confirm .modal-message {
    margin-bottom: 0;
    font-size: 15px;
}

.modal-container.modal-confirm .modal-footer {
    justify-content: center;
}

/* Throbber/Loading spinner styles - reusable across modals and other components */
.modal-throbber-container {
    text-align: center;
    padding: 10px 0;
}

.modal-throbber {
    width: 40px;
    height: 40px;
    display: block;
    margin: 0 auto;
}

.modal-throbber-text {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

/* Larger throbber variant (for login, etc.) */
.throbber-large {
    width: 60px;
    height: 60px;
}

