/* استایل کلی */
.wptoc-telegram-container {
    display: flex;
    height: 70vh;
    max-width: 900px;
    margin: 20px auto;
    border: 1px solid #e2e2e2;
    border-radius: 10px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
}

/* بخش سمت چپ - لیست گفتگوها */
.wptoc-chat-list {
    width: 35%;
    border-right: 1px solid #e2e2e2;
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wptoc-chat-list-header {
    padding: 15px;
    border-bottom: 1px solid #e2e2e2;
    background: #f0f0f0;
}

.wptoc-chat-list-header h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
}

.wptoc-search-box {
    margin-top: 10px;
}

.wptoc-search-box input {
    width: 100%;
    padding: 8px 15px;
    border: none;
    border-radius: 20px;
    background: #fff;
    font-size: 13px;
    outline: none;
}

.wptoc-chat-list-items {
    flex-grow: 1;
    overflow-y: auto;
}

.wptoc-chat-item {
    display: flex;
    padding: 10px 15px;
    border-bottom: 1px solid #e2e2e2;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.wptoc-chat-item:hover {
    background: #e6e6e6;
}

.wptoc-chat-item.active {
    background: #e0e0e0;
}

.wptoc-chat-avatar {
    margin-right: 10px;
    flex-shrink: 0;
}

.wptoc-chat-avatar img {
    border-radius: 50%;
    width: 40px;
    height: 40px;
}

.wptoc-chat-info {
    flex-grow: 1;
    overflow: hidden;
    padding-right: 10px;
}

.wptoc-chat-name {
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
    color: #333;
}

.wptoc-chat-preview {
    font-size: 13px;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wptoc-chat-time {
    font-size: 12px;
    color: #999;
    position: absolute;
    top: 12px;
    right: 15px;
}

.wptoc-no-chats {
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* بخش سمت راست - محتوای گفتگو */
.wptoc-chat-content {
    width: 65%;
    display: flex;
    flex-direction: column;
    background: #e6ebf5;
}

.wptoc-chat-header {
    padding: 15px;
    border-bottom: 1px solid #e2e2e2;
    background: #f0f0f0;
    display: flex;
    align-items: center;
}

.wptoc-chat-title {
    font-weight: 500;
    font-size: 16px;
    color: #333;
}

.wptoc-chat-messages {
    flex-grow: 1;
    padding: 15px;
    overflow-y: auto;
    background: #e6ebf5;
    display: flex;
    flex-direction: column;
}

.wptoc-welcome-message {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    color: #666;
    font-size: 14px;
}

.wptoc-message {
    margin-bottom: 15px;
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 8px;
    position: relative;
    word-wrap: break-word;
    font-size: 14px;
    line-height: 1.4;
}

.wptoc-message-me {
    background: #dcf8c6;
    margin-left: auto;
    border-bottom-right-radius: 0;
}

.wptoc-message-other {
    background: white;
    margin-right: auto;
    border-bottom-left-radius: 0;
}

.wptoc-message-time {
    font-size: 11px;
    color: #666;
    text-align: right;
    margin-top: 3px;
}

.wptoc-chat-input {
    padding: 10px;
    border-top: 1px solid #ddd;
    background: #f5f5f5;
    display: flex;
    align-items: center;
}

.wptoc-chat-input textarea {
    flex-grow: 1;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 8px 15px;
    resize: none;
    height: 40px;
    outline: none;
    font-size: 14px;
    max-height: 120px;
}

.wptoc-chat-input button {
    margin-left: 10px;
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.wptoc-chat-input button:hover {
    background: #0077b3;
}

.wptoc-login-required {
    padding: 20px;
    text-align: center;
    background: #f8f8f8;
    border-radius: 5px;
    margin: 20px 0;
}

/* حالت پاسخگو */
@media (max-width: 768px) {
    .wptoc-telegram-container {
        flex-direction: column;
        height: 80vh;
    }

    .wptoc-chat-list,
    .wptoc-chat-content {
        width: 100%;
        height: 50%;
    }

    .wptoc-chat-list {
        border-right: none;
        border-bottom: 1px solid #e2e2e2;
    }
}
/* استایل پیام موقت */
.wptoc-message[data-temp-id] {
    opacity: 0.7;
}

/* استایل پیام خطا */
.wptoc-message-error {
    opacity: 0.7;
    background-color: #ffebee !important;
}

.wptoc-error-notice {
    color: #f44336;
    font-size: 0.9em;
    margin-right: 5px;
}

/* انیمیشن برای پیام‌های جدید */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.wptoc-message-new {
    animation: fadeIn 0.3s ease-out;
}
/* استایل برای فیلد غیرفعال */
.wptoc-chat-input textarea:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
    border-color: #e0e0e0;
}

.wptoc-send-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}
.wptoc-chat-input-end-chet{
    text-align: center;
    width: 100%;
}
/* استایل بخش آپلود */
.wptoc-upload-container {
    position: relative;
    margin-left: 5px;
}

.wptoc-upload-button {
    background: #0088cc;
    color: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.wptoc-upload-button:hover {
    background: #0073aa;
}

.wptoc-upload-button .dashicons {
    font-size: 20px;
    width: auto;
    height: auto;
}

/* استایل پیش‌نمایش فایل */
.wptoc-file-preview {
    display: flex;
    align-items: center;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 5px;
    margin-bottom: 10px;
}

.wptoc-file-preview img {
    max-width: 50px;
    max-height: 50px;
    margin-right: 10px;
}

.wptoc-file-info {
    flex-grow: 1;
}

.wptoc-file-name {
    font-size: 13px;
    margin-bottom: 5px;
}

.wptoc-file-size {
    font-size: 11px;
    color: #666;
}

.wptoc-remove-file {
    color: #ff0000;
    cursor: pointer;
    margin-left: 10px;
}
/* استایل نمایش فایل‌ها */
.wptoc-message-file {
    max-width: 300px;
    margin-bottom: 5px;
}

.wptoc-file-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
    display: block;
}

.wptoc-file-download {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
}

.wptoc-file-download .dashicons {
    margin-left: 5px;
    font-size: 20px;
}

.wptoc-file-caption {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
}
/* استایل نمایش تصاویر */
.wptoc-file-image {
    max-width: 100%;
    max-height: 200px;
    border-radius: 5px;
    display: block;
    margin-bottom: 5px;
}

/* استایل کلی پیام‌های حاوی فایل */
.wptoc-message-file {
    max-width: 300px;
    margin-bottom: 5px;
    word-break: break-word;
}

/* استایل لینک دانلود فایل */
.wptoc-file-download {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    background: #f5f5f5;
    border-radius: 5px;
    color: #333;
    text-decoration: none;
    margin-bottom: 5px;
}

.wptoc-file-download:hover {
    background: #e0e0e0;
}

.wptoc-file-download .dashicons {
    margin-left: 5px;
    font-size: 20px;
}

/* استایل توضیحات فایل */
.wptoc-file-caption {
    margin-top: 5px;
    font-size: 13px;
    color: #666;
    line-height: 1.4;
}

.call-session-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}
.call-session-card {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 15px;
    width: 300px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    background-color: #fff;
    transition: transform 0.2s;
}
.call-session-card:hover {
    transform: scale(1.02);
}
.call-session-card h4 {
    margin-top: 0;
    color: #0073aa;
}
.call-session-card p {
    margin: 5px 0;
}
.call-status {
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
}
.status-pendding { background-color: #ffefc5; color: #b48b00; }
.status-called   { background-color: #d4f4d7; color: #2d7a2e; }
.status-cancelled { background-color: #ffd6d6; color: #a10000; }