/* POA Master Modal - Centered & Aligned Layout */

/* Force Bootstrap modal backdrop and centering */
#addpoamaster.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1050;
    width: 100%;
    height: 100%;
    overflow: hidden;
    outline: 0;
}

#addpoamaster.modal.show {
    display: block !important;
}

/* Modal dialog centering and sizing */
#addpoamaster .modal-dialog {
    max-width: 850px;
    width: 90%;
    margin: 1.75rem auto;
    position: relative;
}

/* Ensure modal is centered vertically */
#addpoamaster .modal-dialog-centered {
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

/* Modal content */
#addpoamaster .modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 90vh;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: 0.3rem;
    outline: 0;
}

/* Modal body padding with scroll */
#addpoamaster .modal-body {
    padding: 25px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
}

/* Row alignment - all fields align at top */
#addpoamaster .row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 15px;
    margin-left: -15px;
    margin-right: -15px;
}

/* Equal width columns */
#addpoamaster .col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 15px;
    padding-right: 15px;
}

#addpoamaster .col-md-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Form groups */
#addpoamaster .form-group {
    margin-bottom: 0;
    width: 100%;
}

/* Labels */
#addpoamaster .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 14px;
}

/* All form controls unified height */
#addpoamaster .form-control,
#addpoamaster select.form-control,
#addpoamaster input[type="text"].form-control,
#addpoamaster input[type="date"].form-control {
    width: 100%;
    height: 38px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Textarea - reduced height to match adjacent fields better */
#addpoamaster textarea.form-control {
    height: auto;
    min-height: 74px;
    max-height: 150px;
    resize: vertical;
    line-height: 1.42857143;
}

/* File input */
#addpoamaster .form-control-file {
    width: 100%;
    padding: 6px 0;
}

/* Red asterisk color */
#addpoamaster .red-color {
    color: #d9534f;
}

/* Button alignment */
#addpoamaster .text-center {
    text-align: center;
}

#addpoamaster .btn {
    padding: 8px 20px;
    font-size: 14px;
    border-radius: 4px;
}

/* Responsive design for tablets */
@media (max-width: 991px) {
    #addpoamaster .modal-dialog {
        max-width: 720px;
    }
}

/* Responsive design for mobile */
@media (max-width: 767px) {
    #addpoamaster .col-md-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    #addpoamaster .row {
        margin-bottom: 10px;
    }
    
    #addpoamaster .modal-dialog {
        max-width: 95%;
        margin: 0.5rem auto;
    }
    
    #addpoamaster .modal-body {
        padding: 15px;
        max-height: calc(100vh - 150px);
    }
    
    #addpoamaster textarea.form-control {
        min-height: 60px;
    }
}

/* Small mobile devices */
@media (max-width: 575px) {
    #addpoamaster .modal-dialog {
        margin: 0.25rem;
        width: calc(100% - 0.5rem);
    }
    
    #addpoamaster .modal-body {
        max-height: calc(100vh - 120px);
    }
}

/* Scrollbar styling for modal body */
#addpoamaster .modal-body::-webkit-scrollbar {
    width: 8px;
}

#addpoamaster .modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

#addpoamaster .modal-body::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

#addpoamaster .modal-body::-webkit-scrollbar-thumb:hover {
    background: #555;
}
