/* Admin Contact Modal CSS */

.pioneer-modal {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    font-family: 'Tajawal', sans-serif;
    backdrop-filter: blur(3px);
}

.pioneer-modal-content {
    background-color: #fff;
    margin: 3% auto;
    padding: 0;
    width: 85%;
    max-width: 1100px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    animation: modalFadeIn 0.4s ease-in-out;
    transform: translateY(0);
    transition: transform 0.3s ease;
}

@keyframes modalFadeIn {
    from {
        transform: translateY(-70px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.pioneer-modal-header {
    padding: 18px 24px;
    background-color: #f1bd03;
    color: #0a1622;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pioneer-modal-header h2 {
    margin: 0;
    font-size: 1.6rem;
    font-weight: bold;
    flex: 1;
}

.pioneer-modal-body {
    padding: 24px;
    max-height: 65vh;
    overflow-y: auto;
    scrollbar-width: thin;
}

.pioneer-modal-body::-webkit-scrollbar {
    width: 8px;
}

.pioneer-modal-body::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.pioneer-modal-body::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.pioneer-modal-body::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

.pioneer-modal-footer {
    padding: 18px 24px;
    background-color: #f8f8f8;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e0e0e0;
}

.pioneer-modal-close {
    color: #0a1622;
    float: left;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.pioneer-modal-close:hover {
    color: #333;
    transform: scale(1.1);
}


/* Contact table styling */

.contacts-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-box {
    position: relative;
    width: 300px;
}

.search-box input {
    width: 100%;
    padding: 10px 15px 10px 40px;
    border-radius: 30px;
    border: 1px solid #ddd;
    font-size: 14px;
}

.search-box iconify-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #777;
}

.table-info {
    margin-top: 10px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #777;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.contacts-table-wrapper {
    margin-top: 15px;
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background-color: #fff;
}

.contacts-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    table-layout: fixed;
}

.contacts-table th,
.contacts-table td {
    padding: 12px 15px;
    text-align: right;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: top;
}

.contacts-table th {
    background-color: #f8f8f8;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.85em;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.contacts-table tr:last-child td {
    border-bottom: none;
}

.contacts-table tr:hover {
    background-color: #f9f9f9;
}

.contact-row {
    transition: all 0.3s ease;
}

.contact-row.status-changing {
    background-color: rgba(241, 189, 3, 0.1) !important;
}

.contact-row.deleting {
    background-color: rgba(255, 82, 82, 0.1) !important;
}

.contact-row.unread {
    background-color: #fff9eb;
    font-weight: 500;
}

.contacts-table td:nth-child(1) {
    width: 13%;
}

.contacts-table td:nth-child(2) {
    width: 15%;
}

.contacts-table td:nth-child(3) {
    width: 13%;
}

.contacts-table td:nth-child(4) {
    width: 30%;
}

.contacts-table td:nth-child(5) {
    width: 12%;
}

.contacts-table td:nth-child(6) {
    width: 7%;
}

.contacts-table td:nth-child(7) {
    width: 10%;
}

.status-badge {
    display: inline-block;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: bold;
    transition: all 0.3s ease;
}

.status-badge.unread {
    background-color: #f1bd03;
    color: #0a1622;
}

.status-badge.read {
    background-color: #e0e0e0;
    color: #555;
}

.actions-cell {
    white-space: nowrap;
}

.mark-btn,
.delete-btn {
    padding: 6px 12px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.85em;
    transition: all 0.3s ease;
}

.mark-btn {
    background-color: #f1bd03;
    color: #0a1622;
    margin-left: 5px;
}

.mark-btn:hover {
    background-color: #e0af00;
    transform: translateY(-2px);
}

.mark-btn:active {
    transform: translateY(0);
}

.delete-btn {
    background-color: #ff5252;
    color: white;
}

.delete-btn:hover {
    background-color: #ff0000;
    transform: translateY(-2px);
}

.delete-btn:active {
    transform: translateY(0);
}

.mark-btn.processing,
.delete-btn.processing,
button.processing {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}


/* Phone actions styling */

.phone-actions {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.action-buttons {
    display: flex;
    gap: 8px;
    margin-top: 3px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    color: white;
    transition: all 0.2s ease;
}

.call-btn {
    background-color: #4CAF50;
}

.call-btn:hover {
    background-color: #3e9142;
    transform: translateY(-2px);
}

.whatsapp-btn {
    background-color: #25D366;
}

.whatsapp-btn:hover {
    background-color: #20bd5a;
    transform: translateY(-2px);
}


/* Filter buttons */

.contact-filters {
    margin-bottom: 15px;
}

.filter-btn {
    padding: 8px 16px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.filter-btn.active {
    background-color: #f1bd03;
    color: #0a1622;
    border-color: #f1bd03;
    box-shadow: 0 3px 5px rgba(241, 189, 3, 0.2);
}

.filter-btn:hover:not(.active) {
    background-color: #e8e8e8;
    transform: translateY(-2px);
}

.filter-btn:active:not(.active) {
    transform: translateY(0);
}


/* No contacts message */

.no-contacts {
    text-align: center;
    padding: 50px 20px;
    color: #777;
    font-style: italic;
    background-color: #f9f9f9;
    border-radius: 10px;
    border: 1px dashed #ddd;
    font-size: 1.2em;
}


/* RTL Specific styles */

html[dir="rtl"] .pioneer-modal-close {
    float: right;
}

html[dir="rtl"] .pioneer-modal-footer {
    text-align: right;
}

html[dir="rtl"] .filter-btn {
    margin-left: 0;
    margin-right: 10px;
}

html[dir="rtl"] .search-box iconify-icon {
    left: auto;
    right: 15px;
}

html[dir="rtl"] .search-box input {
    padding: 10px 40px 10px 15px;
}


/* Responsive adjustments */

@media screen and (max-width: 782px) {
    .pioneer-modal-content {
        width: 95%;
        margin: 5% auto;
    }
    .pioneer-modal-header h2 {
        font-size: 1.3rem;
    }
    .contacts-table {
        font-size: 0.85em;
    }
    .contacts-table th,
    .contacts-table td {
        padding: 10px 8px;
    }
    .mark-btn,
    .delete-btn {
        padding: 5px 8px;
        font-size: 0.75em;
    }
    .search-box {
        width: 100%;
        max-width: 100%;
    }
    .contacts-header {
        flex-direction: column;
        gap: 15px;
    }
    .filter-btn {
        padding: 6px 12px;
        margin-bottom: 5px;
    }
}


/* Buttons in footer */

.modal-footer-btn {
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-close {
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    color: #333;
}

.btn-close:hover {
    background-color: #e8e8e8;
}

.btn-primary {
    background-color: #f1bd03;
    color: #0a1622;
    border: 1px solid #f1bd03;
}

.btn-primary:hover {
    background-color: #e0af00;
}

.btn-danger {
    background-color: #ff5252;
    color: white;
    border: 1px solid #ff5252;
}

.btn-danger:hover {
    background-color: #ff0000;
}


/* Message styling */

.message-content {
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 150px;
    overflow-y: auto;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #eee;
    line-height: 1.5;
}

.message-content::-webkit-scrollbar {
    width: 6px;
}

.message-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.message-content::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 10px;
}

.message-content::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}