/* Custom Modal System - Bootstrap Replacement */

/* Modal backdrop */
.custom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1055;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.custom-modal.show {
    display: flex;
    opacity: 1;
}

.custom-modal.fade-in {
    opacity: 1;
}

/* Modal dialog containers */
.custom-modal-dialog {
    position: relative;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    margin: 1.75rem auto;
    pointer-events: auto;
    transform: translateY(-50px);
    transition: transform 0.3s ease-out;
}

.custom-modal.show .custom-modal-dialog {
    transform: translateY(0);
}

/* Modal dialog sizes */
.custom-modal-dialog.modal-sm {
    max-width: 300px;
}

.custom-modal-dialog.modal-lg {
    max-width: 800px;
}

.custom-modal-dialog.modal-xl {
    max-width: 1140px;
}

/* Modal content */
.custom-modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgb(229, 231, 235);
    border-radius: 0.5rem;
    outline: 0;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Modal header */
.custom-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid rgb(229, 231, 235);
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
}

.custom-modal-title {
    margin: 0;
    line-height: 1.5;
    font-size: 1.25rem;
    font-weight: 500;
}

/* Modal body */
.custom-modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
    overflow-y: auto;
}

/* Modal footer */
.custom-modal-footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid rgb(229, 231, 235);
    border-bottom-right-radius: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    gap: 0.5rem;
}

/* Close button */
.custom-btn-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    line-height: 1;
    color: #000;
    text-decoration: none;
    opacity: 0.5;
    cursor: pointer;
    padding: 0.25rem;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.custom-btn-close:hover {
    opacity: 0.75;
}

.custom-btn-close::before {
    content: "×";
    font-size: 1.5rem;
    line-height: 1;
}

/* Custom button styles to replace Bootstrap buttons */
.custom-btn {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.custom-btn:hover {
    text-decoration: none;
}

.custom-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.custom-btn:disabled {
    pointer-events: none;
    opacity: 0.65;
}

/* Button variants */
.custom-btn-primary {
    color: #fff;
    background-color: #0d6efd;
    border-color: #0d6efd;
}

.custom-btn-primary:hover {
    color: #fff;
    background-color: #0b5ed7;
    border-color: #0a58ca;
}

.custom-btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.custom-btn-secondary:hover {
    color: #fff;
    background-color: #5c636a;
    border-color: #565e64;
}

.custom-btn-success {
    color: #fff;
    background-color: #198754;
    border-color: #198754;
}

.custom-btn-success:hover {
    color: #fff;
    background-color: #157347;
    border-color: #146c43;
}

.custom-btn-danger {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.custom-btn-danger:hover {
    color: #fff;
    background-color: #c82333;
    border-color: #bd2130;
}

/* Force white background and proper input styling */
.custom-modal-content {
    background-color: #fff;
    color: #1f2937;
}

.custom-modal-body input,
.custom-modal-body textarea {
    color: #1f2937;
}

/* Dark theme support - but force white for this modal */
@media (prefers-color-scheme: dark) {
    .custom-modal-content {
        background-color: #fff;
        color: #1f2937;
        border-color: rgb(229, 231, 235);
    }
    
    .custom-modal-header,
    .custom-modal-footer {
        border-color: rgb(229, 231, 235);
    }
    
    .custom-btn-close {
        color: #000;
    }
    
    .custom-modal-body input,
    .custom-modal-body textarea {
        color: #1f2937;
        background-color: #fff;
    }
}

/* Additional utility classes to replace common Bootstrap classes */
.flex {
    display: flex;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.mr-3 {
    margin-right: 0.75rem;
}

.ml-3 {
    margin-left: 0.75rem;
}

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.opacity-50 {
    opacity: 0.5;
}

.cursor-not-allowed {
    cursor: not-allowed;
}

.cursor-pointer {
    cursor: pointer;
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .custom-modal-dialog {
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .custom-modal-dialog.modal-xl,
    .custom-modal-dialog.modal-lg {
        max-width: none;
    }
}

/* Responsive adjustments for smaller viewport heights */
@media (max-height: 700px) {
    .custom-modal-dialog {
        margin: 0.5rem auto;
        max-height: 95vh;
    }
}

@media (max-height: 600px) {
    .custom-modal-dialog {
        margin: 0.25rem auto;
        max-height: 98vh;
    }
}

@media (max-height: 500px) {
    .custom-modal-dialog {
        margin: 0.125rem auto;
        max-height: 99vh;
    }
} 