/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Content */
.modal-content {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease-in-out;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* Modal Header */
.modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
    position: relative;
}

.modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #2d3748;
}

.close-modal {
    position: absolute;
    top: 20px;
    right: 25px;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #1a202c;
}

/* Modal Body */
.modal-body {
    padding: 25px;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #4a5568;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #2d3748;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #4299e1;
    outline: 0;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.2);
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* Submit Button */
.btn-submit {
    display: inline-block;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
    width: 100%;
    background-color: #3182ce;
    color: white;
    cursor: pointer;
    margin-top: 0.5rem;
}

.btn-submit:hover {
    background-color: #2c5282;
}

.btn-submit:disabled {
    background-color: #a0aec0;
    cursor: not-allowed;
}

/* Messages */
.form-message {
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: none;
}

.form-success {
    background-color: #f0fff4;
    color: #2f855a;
    border: 1px solid #c6f6d5;
}

.form-error {
    background-color: #fff5f5;
    color: #c53030;
    border: 1px solid #fed7d7;
}

/* Responsive Adjustments */
@media (max-width: 576px) {
    .modal-content {
        margin: 0 10px;
    }
    
    .modal-header,
    .modal-body {
        padding: 15px;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
}

/* Custom Select Styling */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.7rem;
    top: 50%;
    right: 1rem;
    position: absolute;
    transform: translateY(-50%);
    pointer-events: none;
    color: #4a5568;
}

/* Hide number input spinners */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

/* Loading Spinner */
.spinner-border {
    display: inline-block;
    width: 1rem;
    height: 1rem;
    vertical-align: text-bottom;
    border: 0.2em solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner-border 0.75s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spinner-border {
    to { transform: rotate(360deg); }
}

/* Custom Checkbox */
.custom-checkbox {
    display: flex;
    align-items: center;
    margin-top: 1rem;
    font-size: 0.875rem;
    color: #4a5568;
}

.custom-checkbox input[type="checkbox"] {
    margin-right: 0.5rem;
    width: 1rem;
    height: 1rem;
}
