/* common.css - Shared styles across all pages */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    direction: rtl;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.btn {
    background-color: #4285f4;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
}

.btn:hover {
    background-color: #357abd;
}


/* login.css - Styles specific to the login page */
body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.container {
    text-align: center;
    padding: 40px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.btn {
    margin-top: 20px;
    padding: 12px 24px;
}


/* dashboard.css - Styles specific to the dashboard page */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border: none;
    background: none;
    font-size: 16px;
    color: #666;
}

.tab.active {
    color: #4285f4;
    border-bottom: 2px solid #4285f4;
}

.tab-content {
    display: none;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tab-content.active {
    display: block;
}

/* Email Form Styles */
.email-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.form-group label {
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Attachment Styles */
.attachment-preview {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

.attachment-item {
    position: relative;
    width: 100px;
    height: 100px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.attachment-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-item button {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255,255,255,0.8);
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Chat Styles */
.chat-container {
    height: 600px;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    margin: 5px 0;
}

.message.sent {
    background-color: #4285f4;
    color: white;
    align-self: flex-start;
}

.message.received {
    background-color: #e9ecef;
    color: black;
    align-self: flex-end;
}

.message-header {
    font-size: 12px;
    margin-bottom: 5px;
    opacity: 0.8;
}

.message-content {
    word-wrap: break-word;
}




/* עיצוב מחודש לאזור הצ'אט */

/* מבנה כללי של אזור הצ'אט */
.chat-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 0;
    height: 80vh;
    min-height: 600px;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* רשימת אנשי קשר */
.contacts-list {
    border-left: 1px solid #e0e0e0;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* תיבת חיפוש */
.search-box {
    padding: 16px;
    background: white;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-box input {
    width: 100%;
    padding: 10px 35px 10px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    font-size: 14px;
}

.search-box i {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
}

/* רשימת השיחות */
#contactsList {
    flex: 1;
    overflow-y: auto;
}

.contact-item {
    padding: 15px 20px;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    transition: all 0.2s ease;
}

.contact-item:hover {
    background: #f0f0f0;
}

.contact-item.selected {
    background: #e3f2fd;
    border-right: 4px solid #2196f3;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.contact-name {
    font-weight: 600;
    color: #202124;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-email {
    font-size: 13px;
    color: #5f6368;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.contact-date {
    font-size: 12px;
    color: #80868b;
    margin-top: 4px;
}

/* חלון הצ'אט */
.chat-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #f5f5f5;
}

/* עיצוב ההודעות */
.message {
    max-width: 70%;
    margin: 15px 0;
    padding: 12px 16px;
    border-radius: 12px;
    position: relative;
    clear: both;
}

.message.sent {
    float: left;
    background: #e3f2fd;
    color: #1565c0;
    border-bottom-left-radius: 4px;
    margin-right: auto;
}

.message.received {
    float: right;
    background: white;
    color: #202124;
    border-bottom-right-radius: 4px;
    margin-left: auto;
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.message-header {
    font-size: 12px;
    margin-bottom: 6px;
    color: #5f6368;
}

.message-content {
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

/* טופס תגובה */
.reply-form {
    padding: 15px;
    background: white;
    border-top: 1px solid #e0e0e0;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.reply-form textarea {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    resize: none;
    min-height: 50px;
    max-height: 150px;
    font-size: 14px;
}

.reply-form button {
    padding: 12px 20px;
    background: #2196f3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.reply-form button:hover {
    background: #1976d2;
}

/* גלילה מותאמת */
.contacts-list, .chat-messages {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

.contacts-list::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.contacts-list::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* התאמה למסכים קטנים */
@media (max-width: 768px) {
    .chat-layout {
        grid-template-columns: 1fr;
        height: 90vh;
    }
    
    .contacts-list {
        display: none;
    }
    
    .contacts-list.active {
        display: block;
        position: absolute;
        top: 0;
        right: 0;
        width: 100%;
        height: 100%;
        z-index: 100;
    }
}