/* CHAT MODAL - OFFSZN (Instagram Style) */

/* Overlay */
.chat-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: none;
    /* Hidden by default */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2sease;
}

.chat-modal-overlay.active {
    display: flex;
    opacity: 1;
}

/* Modal Container */
.chat-modal-container {
    background: #262626;
    width: 400px;
    max-width: 90%;
    height: 600px;
    max-height: 80vh;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    transform: scale(1.1);
    transition: transform 0.2s cubic-bezier(0.1, 0.9, 0.2, 1);
    border: 1px solid #363636;
}

.chat-modal-overlay.active .chat-modal-container {
    transform: scale(1);
}

/* Header */
.chat-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #363636;
}

.chat-modal-title {
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    flex: 1;
    text-align: center;
}

.chat-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
}

/* Search Bar */
.chat-modal-search {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-bottom: 1px solid #363636;
}

.chat-modal-label {
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    margin-right: 12px;
}

.chat-modal-input {
    background: none;
    border: none;
    color: #fff;
    font-size: 0.9rem;
    flex: 1;
    outline: none;
    padding: 8px 0;
}

.chat-modal-input::placeholder {
    color: #a8a8a8;
}

/* Results List */
.chat-modal-results {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

/* Custom Scrollbar for Modal Results */
.chat-modal-results::-webkit-scrollbar {
    width: 6px;
}

.chat-modal-results::-webkit-scrollbar-track {
    background: transparent;
}

.chat-modal-results::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 10px;
}

.chat-modal-results::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.chat-modal-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: background 0.1s;
}

.chat-modal-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.chat-modal-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    margin-right: 12px;
    background-color: #333;
    overflow: hidden;
}

.chat-modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-modal-user-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-modal-username {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
}

.chat-modal-fullname {
    color: #a8a8a8;
    font-size: 0.85rem;
}

/* Checkbox / Selection Circle */
.chat-modal-selection {
    width: 24px;
    height: 24px;
    border: 2px solid #555;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chat-modal-item.selected .chat-modal-selection {
    background: #0095f6;
    /* Instagram Blue or use #8b5cf6 for OFFSZN purple */
    border-color: #0095f6;
}

.chat-modal-selection::after {
    content: '✔';
    color: #fff;
    font-size: 14px;
    display: none;
}

.chat-modal-item.selected .chat-modal-selection::after {
    display: block;
}

/* Footer / Action Button */
.chat-modal-footer {
    padding: 16px;
    border-top: 1px solid #363636;
}

.chat-modal-btn {
    width: 100%;
    padding: 12px;
    background: #0095f6;
    color: #fff;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    opacity: 0.5;
    pointer-events: none;
    /* Disabled by default */
    transition: opacity 0.2s;
}

.chat-modal-btn.active {
    opacity: 1;
    pointer-events: all;
}

/* Skeletons for Modal */
.modal-skeleton-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
}

.modal-skeleton-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: #333;
    margin-right: 12px;
}

.modal-skeleton-line {
    height: 10px;
    background: #333;
    border-radius: 4px;
    width: 100px;
}