/* Modal Custom Styles */
.modal-custom-size {
    max-width: 1237px;
    width: 100%;
}

.modal-custom {
    background: #FFFFFF;
    box-shadow: 0px 20px 13px rgba(0, 0, 0, 0.03), 0px 8px 5px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    border: none;
}

/* Modal Header */
.modal-header-custom {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    gap: 39px;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7E8;
    border-radius: 12px 12px 0 0;
}

.modal-title-custom {
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 18px;
    line-height: 21px;
    color: #1E1E1E;
    margin: 0;
}

.btn-close-custom {
    background: none;
    border: none;
    padding: 0;
    width: 16px;
    height: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Modal Body */
.modal-body-custom {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px;
    gap: 15px;
}

.modal-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 16px;
    width: 100%;
    background: #EFEFEF;
    border: 1px solid #CAD2D6;
    border-radius: 12px;
}

.modal-form-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    width: 100%;
}

/* Field Group */
.modal-field-group {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
}

.modal-label {
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 120%;
    color: #1E1E1E;
    margin: 0;
}

.modal-textarea-wrapper {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    padding: 16px;
    width: 100%;
    background: #FFFFFF;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.08);
    border-radius: 10px;
}

.modal-textarea {
    width: 100%;
    border: none;
    outline: none;
    resize: vertical;
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 120%;
    color: #1E1E1E;
    background: transparent;
    min-height: 150px;
}

.modal-textarea::placeholder {
    color: #9D9D9D;
}

.modal-textarea:focus {
    outline: none;
    box-shadow: none;
}

/* Actions Row */
.modal-actions-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    height: 23px;
}

/* Modal Footer */
.modal-footer-custom {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 24px;
    gap: 10px;
    border-top: 1px solid #E5E7EB;
    background: #FFFFFF;
    border-radius: 0 0 12px 12px;
}

.modal-btn-cancel {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 10px;
    width: 83px;
    height: 39px;
    background: #FFFFFF;
    border: 1px solid #E1E1E1;
    border-radius: 7px;
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: #1E1E1E;
    transition: background-color 0.2s ease;
}

.modal-btn-cancel:hover {
    background: #F8F9FA;
    color: #1E1E1E;
}

.modal-btn-save {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
    width: 68px;
    height: 39px;
    background: #073F3B;
    border-radius: 7px;
    border: none;
    font-family: 'Karla', sans-serif;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    color: #FFFFFF;
    transition: background-color 0.2s ease;
}

.modal-btn-save:hover {
    background: #0A5550;
    color: #FFFFFF;
}

/* Custom Modal Styles */
.custom-modal .modal-dialog {
    max-width: 531px;
    margin: 0;
    position: absolute;
    left: calc(50% - 531px/2 + 0.5px);
    top: calc(50% - 644px/2);
}

.custom-modal .modal-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: 0px;
    width: 531px;
    background: #FFFFFF;
    box-shadow: 0px 20px 13px rgba(0, 0, 0, 0.03), 0px 8px 5px rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    border: none;
}

/* Modal Header */
.custom-modal .modal-header {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    width: 100%;
    background: #FFFFFF;
    border-bottom: 1px solid #E5E7EB;
    border-radius: 12px 12px 0px 0px;
}

.custom-modal .modal-title {
    font-family: 'Karla', sans-serif;
    font-weight: 700;
    font-size: 20px;
    line-height: 23px;
    color: #1E1E1E;
    margin: 0;
}

.custom-modal .btn-close {
    width: 24px;
    height: 24px;
    padding: 0;
    margin: 0;
    opacity: 0.5;
}

.custom-modal .btn-close:hover {
    opacity: 1;
}

.custom-modal .modal-body {
    display: flex;
    flex-direction: column;
    padding: 24px;
    gap: 10px;
    width: 100%;
    min-height: 0; /* Prevent unwanted expansion */
    overflow-y: auto;
}

.custom-modal .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}

.custom-modal .form-group:last-child {
    margin-bottom: 0;
}

.custom-modal .col-form-label {
    font-family: 'Karla', sans-serif;
    font-weight: 600;
    font-size: 14px;
    line-height: 16px;
    color: #374151;
    padding: 0;
    margin: 0;
}

.custom-modal .form-control {
    font-family: 'Karla', sans-serif;
    font-weight: 400;
    font-size: 14px;
    line-height: 20px;
    color: #1E1E1E;
    padding: 10px 12px;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    height: auto;
}

.custom-modal .form-control:focus {
    border-color: #54B0A9;
    box-shadow: 0 0 0 3px rgba(84, 176, 169, 0.1);
    outline: none;
}

.custom-modal .form-control.is-invalid {
    border-color: #EF4444;
}

.custom-modal .form-control.is-invalid:focus {
    border-color: #EF4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

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

.custom-modal .text-danger {
    font-family: 'Karla', sans-serif;
    font-size: 12px;
    color: #EF4444;
    margin-top: 4px;
}

/* Modal Footer */
.custom-modal .modal-footer {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: center;
    padding: 16px 24px;
    gap: 10px;
    width: 531px;
    height: 71px;
    background: #FFFFFF;
    border-top: 1px solid #E5E7EB;
    border-radius: 0px 0px 12px 12px;
    flex: none;
    align-self: stretch;
    flex-grow: 0;
}

/* Secondary Button (Cancel) */
.custom-modal .btn-modal-secondary {
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 10px;
    width: 83px;
    height: 39px;
    background: #FFFFFF;
    border: 1px solid #E1E1E1;
    border-radius: 7px;
    flex: none;
    flex-grow: 0;
    font-family: 'Karla', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    text-align: center;
    color: #1E1E1E;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-modal .btn-modal-secondary:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
}

.custom-modal .btn-modal-secondary:active {
    background: #F3F4F6;
}

/* Primary Button (Save) */
.custom-modal .btn-modal-primary {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    padding: 10px 16px;
    gap: 8px;
    width: 68px;
    height: 39px;
    background: #073F3B;
    border: none;
    border-radius: 7px;
    flex: none;
    flex-grow: 0;
    font-family: 'Karla', sans-serif;
    font-style: normal;
    font-weight: 500;
    font-size: 16px;
    line-height: 19px;
    text-align: center;
    color: #FFFFFF;
    cursor: pointer;
    transition: all 0.2s;
}

.custom-modal .btn-modal-primary:hover {
    background: #05302C;
}

.custom-modal .btn-modal-primary:active {
    background: #042620;
}

/* Modal Animation */
.custom-modal.modal.fade .modal-dialog {
    transition: transform 0.3s ease-out;
    transform: translate(0, -50px);
}

.custom-modal.modal.show .modal-dialog {
    transform: none;
}

/* Modal Backdrop */
.custom-modal .modal-backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* Responsive adjustments */
@media (max-width: 1300px) {
    .modal-custom-size {
        max-width: 95%;
    }
}

@media (max-width: 768px) {
    .modal-custom-size {
        max-width: 100%;
        margin: 0.5rem;
    }
    
    .modal-header-custom,
    .modal-body-custom,
    .modal-footer-custom {
        padding: 16px;
    }
}

#addCountryModal .modal-content {
    background: #FFFFFF;
}

#addCountryModal .btn:hover {
    opacity: 0.9;
}

#addCountryModal input[type="text"]:focus {
    outline: none;
    border-color: #073F3B;
    box-shadow: 0 0 0 0.2rem rgba(7, 63, 59, 0.15);
}

#addCountryModal input[type="text"]::placeholder {
    color: #9D9D9D;
}

/* Button hover effects */
#addCountryModal button[style*="background: #073F3B"]:hover {
    background: #095249 !important;
}

#addCountryModal button[style*="background: #E6E7E8"]:hover {
    background: #D5D6D7 !important;
}