/* Unified Modal Component */
.ui-modal {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10001;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ui-modal.show {
    display: flex;
}

.ui-modal.visible {
    opacity: 1;
}

.ui-modal-content {
    position: relative;
    max-width: 500px;
    width: 100%;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.ui-modal.visible .ui-modal-content {
    transform: scale(1);
}

.ui-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ui-modal-title {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #212529;
}

.ui-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.ui-modal-close:hover {
    background-color: #f8f9fa;
    color: #212529;
}

.ui-modal-body {
    padding: 24px;
    color: #212529;
    line-height: 1.6;
}

.ui-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.ui-modal-footer button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.ui-modal-btn-primary {
    background-color: #0d6efd;
    color: #ffffff;
}

.ui-modal-btn-primary:hover {
    background-color: #0b5ed7;
}

.ui-modal-btn-secondary {
    background-color: #6c757d;
    color: #ffffff;
}

.ui-modal-btn-secondary:hover {
    background-color: #5c636a;
}

.ui-modal-btn-danger {
    background-color: #dc3545;
    color: #ffffff;
}

.ui-modal-btn-danger:hover {
    background-color: #bb2d3b;
}

/* Loading Overlay Component */
.ui-loading-overlay {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 10000;
    display: none;
    justify-content: center;
    align-items: center;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ui-loading-overlay.show {
    display: flex;
}

.ui-loading-overlay.visible {
    opacity: 1;
}

.ui-loading-content {
    text-align: center;
}

.ui-loading-content p {
    position: relative;
    right: -8px;
    margin-top: 16px;
    margin-bottom: 0;
}

.ui-loading-spinner {
    position: relative;
    display: inline-block;
    width: 100px;
    height: 100px;
}

.ui-loading-spinner .loader {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    width: 100px;
    height: 100px;
}

.ui-loading-spinner .loader > div {
    position: relative;
    flex-basis: 33%;
    max-width: 33%;
    transform: scale(0);
    transform-origin: center center;
    animation: loader 2s infinite linear;
}

.ui-loading-spinner .loader > div:before {
    content: "";
    position: absolute;
    left: 2px;
    top: 2px;
    right: 2px;
    bottom: 2px;
    background: rgba(3, 65, 87, 255);
}

/* Custom loader background for partner pages */
.ui-loading-overlay.preloader-partner .ui-loading-spinner .loader > div:before {
    background: rgb(100, 10, 15) !important;
}

.ui-loading-spinner .loader > div:nth-of-type(1),
.ui-loading-spinner .loader > div:nth-of-type(5),
.ui-loading-spinner .loader > div:nth-of-type(9) {
    animation-delay: 0.4s;
}

.ui-loading-spinner .loader > div:nth-of-type(4),
.ui-loading-spinner .loader > div:nth-of-type(8) {
    animation-delay: 0.2s;
}

.ui-loading-spinner .loader > div:nth-of-type(2),
.ui-loading-spinner .loader > div:nth-of-type(6) {
    animation-delay: 0.6s;
}

.ui-loading-spinner .loader > div:nth-of-type(3) {
    animation-delay: 0.8s;
}

.ui-loading-text {
    color: #6c757d;
    font-size: 0.875rem;
    margin-top: 8px;
}

@keyframes loader {
    0% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
    80% {
        transform: scale(1);
    }
    100% {
        transform: scale(0);
    }
}

/* Partners List Styles */
.partners-list-header-container {
    gap: 0.5rem 1rem;
    row-gap: 0.75rem;
}

#partners-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.partners-list-table {
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    min-width: 600px;
}

.partners-list-table thead {
    background: #6c757d;
}

.partners-list-header {
    background: #6c757d !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 16px 20px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.partners-list-header:last-child {
    border-right: none !important;
}

.partners-list-checkbox-header {
    background: #6c757d !important;
    color: #ffffff !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    padding: 16px 20px !important;
    text-align: center;
}

.partners-list-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.partners-list-table tbody tr:hover {
    background-color: #f5f7f9 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(3, 65, 87, 0.1);
}

.partners-list-table tbody tr:last-child {
    border-bottom: none;
}

.partners-list-table tbody td {
    padding: 16px 20px !important;
    vertical-align: middle;
    border-right: 1px solid #e5e7eb !important;
    color: #333;
}

.partners-list-table tbody td:last-child {
    border-right: none !important;
    text-align: center;
}

.partners-list-checkbox-cell {
    padding: 12px 20px !important;
    vertical-align: middle;
    position: relative;
    z-index: 1;
    text-align: center;
}

.partners-list-no-cell {
    padding: 16px 20px !important;
    vertical-align: middle;
    text-align: center;
    color: #333;
}

.partners-list-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.partners-list-checkbox {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    margin: 0 !important;
    position: relative;
    z-index: 3;
    accent-color: #dc3545;
}

.partners-list-table tbody tr:hover .partners-list-checkbox {
    opacity: 1;
    visibility: visible;
}

/* Edit Button */
.partners-list-edit-btn {
    background: rgb(100, 10, 15);
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(100, 10, 15, 0.3);
}

.partners-list-edit-btn:hover {
    background: rgb(80, 8, 12);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(100, 10, 15, 0.4);
    color: #ffffff !important;
}

.partners-list-edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(100, 10, 15, 0.3);
}

/* Cancel Mode (when Edit button shows Cancel) */
.partners-list-edit-btn.partners-list-cancel-mode {
    background: #6c757d;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.partners-list-edit-btn.partners-list-cancel-mode:hover {
    background: #5c636a;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.partners-list-edit-btn.partners-list-cancel-mode:active {
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

/* History Button */
.partners-list-history-btn {
    background: rgb(100, 10, 15);
    color: #ffffff !important;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(100, 10, 15, 0.2);
}

.partners-list-history-btn:hover {
    background: rgb(80, 8, 12);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(100, 10, 15, 0.3);
    color: #ffffff !important;
}

.partners-list-history-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(100, 10, 15, 0.2);
}

/* Delete Selected Button */
.partners-list-delete-btn {
    background: #dc3545;
    color: #ffffff !important;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.partners-list-delete-btn:not(:disabled):hover {
    background: #bb2d3b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
    color: #ffffff !important;
}

.partners-list-delete-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.partners-list-delete-btn:disabled {
    background: #d3d3d3;
    color: #999999 !important;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

.partners-list-delete-btn:not(:disabled)::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.partners-list-delete-btn:not(:disabled):hover::before {
    width: 300px;
    height: 300px;
}

/* Partner Approval Button */
#approve-partner-button {
    background-color: rgb(100, 10, 15) !important;
    border-color: rgb(100, 10, 15) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

#approve-partner-button:hover {
    background-color: rgb(80, 8, 12) !important;
    border-color: rgb(80, 8, 12) !important;
    box-shadow: 0 4px 12px rgba(100, 10, 15, 0.4) !important;
}

#approve-partner-button:active {
    box-shadow: 0 2px 6px rgba(100, 10, 15, 0.3) !important;
}

/* Partner History Search Button */
#search-partner-history {
    background-color: rgb(100, 10, 15) !important;
    border-color: rgb(100, 10, 15) !important;
    color: #ffffff !important;
    transition: all 0.3s ease;
}

#search-partner-history:hover {
    background-color: rgb(80, 8, 12) !important;
    border-color: rgb(80, 8, 12) !important;
    box-shadow: 0 4px 12px rgba(100, 10, 15, 0.4) !important;
}

#search-partner-history:active {
    box-shadow: 0 2px 6px rgba(100, 10, 15, 0.3) !important;
}

/* Email Management Styles */
.email-management-header-container {
    gap: 0.5rem 1rem;
    row-gap: 0.75rem;
}

#email-management-list {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.email-management-table {
    border-collapse: separate;
    border-spacing: 0;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid #e5e7eb;
    min-width: 600px;
}

.email-management-table thead {
    background: #6c757d;
}

.email-management-header {
    background: #6c757d !important;
    color: #ffffff !important;
    font-weight: 600;
    padding: 16px 20px !important;
    border-right: 1px solid rgba(255, 255, 255, 0.2) !important;
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.3px;
}

.email-management-header:last-child {
    border-right: none !important;
}

.email-management-table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid #e5e7eb;
}

.email-management-table tbody tr:hover {
    background-color: #f5f7f9 !important;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(3, 65, 87, 0.1);
}

.email-management-table tbody tr:last-child {
    border-bottom: none;
}

.email-management-table tbody td {
    padding: 16px 20px !important;
    vertical-align: middle;
    border-right: 1px solid #e5e7eb !important;
    color: #333;
}

.email-management-table tbody td:last-child {
    border-right: none !important;
    text-align: center;
}

.email-management-checkbox-cell {
    padding: 12px 20px !important;
    vertical-align: middle;
    position: relative;
    z-index: 1;
    text-align: center;
}

.email-management-no-cell {
    padding: 16px 20px !important;
    vertical-align: middle;
    text-align: center;
    color: #333;
}

.email-management-checkbox-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.email-management-checkbox {
    width: 20px !important;
    height: 20px !important;
    cursor: pointer;
    margin: 0 !important;
    position: relative;
    z-index: 3;
    accent-color: #dc3545;
}

.email-management-table tbody tr:hover .email-management-checkbox {
    opacity: 1;
    visibility: visible;
}

/* Edit Button */
.email-management-edit-btn {
    background: rgba(3, 65, 87, 255);
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(3, 65, 87, 0.3);
}

.email-management-edit-btn:hover {
    background: rgba(3, 65, 87, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 65, 87, 0.4);
    color: #ffffff !important;
}

.email-management-edit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(3, 65, 87, 0.3);
}

.email-management-edit-btn.email-management-cancel-mode {
    background: #6c757d;
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

.email-management-edit-btn.email-management-cancel-mode:hover {
    background: #5c636a;
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

.email-management-edit-btn.email-management-cancel-mode:active {
    box-shadow: 0 2px 6px rgba(108, 117, 125, 0.3);
}

/* Add Button */
.email-management-add-btn {
    background: rgba(3, 65, 87, 255);
    color: #ffffff !important;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 6px rgba(3, 65, 87, 0.3);
    margin-left: 8px;
}

.email-management-add-btn:hover {
    background: rgba(3, 65, 87, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(3, 65, 87, 0.4);
    color: #ffffff !important;
}

.email-management-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(3, 65, 87, 0.3);
}

/* Resend Button */
.email-management-resend-btn {
    background: rgba(3, 65, 87, 255);
    color: #ffffff !important;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(3, 65, 87, 0.2);
}

.email-management-resend-btn:hover {
    background: rgba(3, 65, 87, 0.9);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(3, 65, 87, 0.3);
    color: #ffffff !important;
}

.email-management-resend-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(3, 65, 87, 0.2);
}

/* Delete Selected Button */
.email-management-delete-btn {
    background: #dc3545;
    color: #ffffff !important;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.3);
    position: relative;
    overflow: hidden;
}

.email-management-delete-btn:not(:disabled):hover {
    background: #bb2d3b;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
    color: #ffffff !important;
}

.email-management-delete-btn:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(220, 53, 69, 0.3);
}

.email-management-delete-btn:disabled {
    background: #d3d3d3;
    color: #999999 !important;
    cursor: not-allowed;
    box-shadow: none;
    opacity: 0.6;
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1050;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-dialog {
    position: relative;
    width: auto;
    margin: 1.75rem auto;
    max-width: 500px;
}

.modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    pointer-events: auto;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid rgba(0,0,0,.2);
    border-radius: .3rem;
    outline: 0;
}

.modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    border-top-left-radius: .3rem;
    border-top-right-radius: .3rem;
}

.modal-title {
    margin-bottom: 0;
    line-height: 1.5;
    font-weight: 600;
}

.close {
    padding: 1rem;
    margin: -1rem -1rem -1rem auto;
    background: transparent;
    border: 0;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    cursor: pointer;
}

.close:hover {
    opacity: .75;
}

.modal-body {
    position: relative;
    flex: 1 1 auto;
    padding: 1rem;
}

.modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    border-top: 1px solid #e9ecef;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: inline-block;
    margin-bottom: .5rem;
    font-weight: 600;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: .25rem;
    transition: border-color .15s ease-in-out,box-shadow .15s ease-in-out;
}

.form-control.is-invalid {
    border-color: #dc3545;
}

.btn-secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    cursor: pointer;
}

.btn-secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

.btn-primary {
    color: #fff;
    background-color: rgba(3, 65, 87, 255);
    border-color: rgba(3, 65, 87, 255);
    padding: .375rem .75rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: .25rem;
    cursor: pointer;
}

.btn-primary:hover {
    background-color: rgba(3, 65, 87, 0.9);
    border-color: rgba(3, 65, 87, 0.9);
}

