/* ===== CHAT PAGE GLOBAL ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #0d4d44;
    direction: rtl;
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== HEADER ========== */
header {
    background: #fff;
    padding: 12px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-logo { 
    height: 85px; /* הגדלנו מ-60 ל-85 כדי להתאים לשאר האתר */
    width: auto; 
    object-fit: contain; 
    display: block;
    transition: height 0.2s; /* מעבר חלק במעבר בין מסכים */
}

/* התאמה לנייד - שלא יהיה ענק מדי בטלפון */
@media (max-width: 600px) {
    .header-logo {
        height: 55px; /* בנייד הוא עדיין צריך להיות קצת יותר קטן */
    }
}

.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a {
    color: #0d4d44;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0 10px;
}
.header-nav a:hover { color: #d63031; }
.nav-sep { color: #ccc; }

/* ========== LAYOUT & CARD ========== */
.chat-main {
    flex: 1;
    max-width: 760px;
    width: 100%;
    margin: 30px auto;
    padding: 0 15px;
    display: flex;
    flex-direction: column;
}

.chat-card {
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-top-bar { background: #d63031; height: 7px; }

.chat-card-header {
    padding: 20px;
    border-bottom: 2px solid #f4f7f6;
    display: flex;
    align-items: center;
    gap: 14px;
}

.chat-icon {
    width: 40px; height: 40px;
    background: #0d4d44;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-size: 1.2rem;
}

/* ========== CHAT WINDOW & MESSAGES ========== */
#chat-window {
    flex: 1;
    height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    background: #f4f7f6;
}

.message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 0.92rem;
    position: relative;
}

.mine { background: #d4edda; align-self: flex-start; border-bottom-right-radius: 2px; }
.theirs { background: #fff; align-self: flex-end; border-bottom-left-radius: 2px; border: 1px solid #ddd; }

/* ========== INPUT AREA ========== */
.chat-input-area { padding: 15px; border-top: 1px solid #eee; background: #fff; }
#messageForm { display: flex; gap: 8px; }
#msgInput {
    flex: 1;
    padding: 12px 18px;
    border: 1.5px solid #ddd;
    border-radius: 25px;
    outline: none;
}
#btn-send {
    width: 45px; height: 45px;
    background: #0d4d44;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transform: scaleX(-1); /* היפוך האייקון לעברית */
}

/* ========== RESPONSIVE - תיקון לטלפון ========== */
@media (max-width: 600px) {
    header {
        flex-direction: column; /* לוגו למעלה, תפריט למטה */
        padding: 15px;
        gap: 12px;
    }
    
    .header-logo { height: 45px; }
    
    .header-nav {
        width: 100%;
        justify-content: center;
        border-top: 1px solid #eee;
        padding-top: 10px;
    }

    .chat-main { margin: 10px auto; }
    
    .chat-card-header h2 { font-size: 1.1rem; }
    
    #chat-window { height: 320px; }
}