/* בסיס */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: linear-gradient(135deg, #ece9f7, #dfe6ff);
}

/* כותרת */
#top {
    background: white;
    padding: 15px;
    text-align: center;
    font-weight: bold;
    border-bottom: 1px solid #ddd;
    font-size: 18px;
}

/* כפתורים */
button {
    padding: 10px 15px;
    border-radius: 20px;
    border: none;
    background: #6c5ce7;
    color: white;
    cursor: pointer;
    transition: 0.2s;
}

button:hover {
    background: #5a4bd1;
}

/* שדות */
input {
    padding: 10px;
    border-radius: 20px;
    border: 1px solid #ccc;
    outline: none;
}

/* הודעות */
#messages {
    height: calc(100vh - 150px);
    overflow-y: auto;
    padding: 15px;
}

.msg {
    margin: 10px 0;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 65%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeIn 0.2s ease;
}

.me {
    background: #e4e7ff;
    margin-left: auto;
    text-align: right;
}

.other {
    background: white;
    margin-right: auto;
}

.system {
    text-align: center;
    color: gray;
    font-size: 13px;
}

.time {
    display: block;
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

/* אזור תחתון */
#login, #inputBox {
    position: fixed;
    width: 100%;
    display: flex;
    gap: 10px;
    padding: 10px;
    background: white;
    border-top: 1px solid #ddd;
}

#login { bottom: 70px; }
#inputBox { bottom: 0; display: none; }

/* אינדקס */
#container {
    padding: 20px;
}

/* כרטיס צאט משודרג */
/* כרטיס צאט קטן ומעוצב */
.room {
    background: linear-gradient(135deg, #ffffff, #f3f4ff);
    padding: 12px 16px;
        margin: 10px 0 10px auto; /* 👈 מצמיד לימין */
 /* 👈 מרכז אותו */
    
    width: 90%;
    max-width: 500px; /* 👈 זה הקסם */

    border-radius: 18px;
    cursor: pointer;
    transition: 0.25s;

    display: flex;
    justify-content: space-between;
    align-items: center;

    direction: rtl;
    text-align: right;

    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border: 1px solid #ececff;
}

.room:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

/* שם הצאט */
.room span:first-child {
    font-weight: bold;
    font-size: 16px;
    color: #333;
}

/* מספר הודעות */
.count {
    font-size: 12px;
    color: #666;
    background: #e9ecff;
    padding: 4px 10px;
    border-radius: 12px;
}


/* אנימציה */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}1
/* מרכז את הרשימה ולא על כל המסך */
#rooms {
    max-width: 700px;
    margin: 0 auto;
}


/* כותרת רשימת הצאטים */
#title {
    width: 90%;
    max-width: 500px;

    margin: 20px 0 10px auto; /* 👈 ימין */
    
    text-align: right; /* 👈 טקסט לימין */
    font-size: 22px;
    font-weight: bold;
}
.edit-chat-btn {
    background: #e0e0e0;           /* אפור עדין */
    color: #333;                    /* טקסט כהה */
    border: 1px solid #ccc;         /* גבול עדין */
    border-radius: 12px;
    padding: 6px 14px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.edit-chat-btn:hover {
    background: #d5d5d5;            /* מעט כהה יותר בהובר */
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.edit-chat-btn:active {
    background: #cfcfcf;
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
#container {
    display: flex;
    flex-direction: column;
    align-items: center; /* הכל ממורכז */
}

/* השדות עצמם */
#user, #pass {
    width: 100%;
    max-width: 300px;
    display: block;
    margin: 10px 0;
}

/* 🔥 הודעת שגיאה בדיוק באותו מקום */
#errorBox {
    display: none;

    width: 100%;
    max-width: 300px;

    margin: 5px 0; /* בדיוק בין השדות */

    padding: 10px;
    border-radius: 20px;

    background: #ffd6d6;
    color: #b30000;
    font-weight: 600;
    text-align: right;

    border: 1px solid #ff9999;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}
#registerBtn {
    margin-top: 10px; /* תשנה את הערך לפי המרווח שתרצה */
}
/* רק לדף הרשמה */
.auth-page {
    margin: 0;
    height: 100vh;

    /* 🎯 רקע כהה מודרני */
    background: #0f172a;

    display: flex;
    justify-content: center;
    align-items: center;

    font-family: Arial, sans-serif;
}

/* ✨ קווים עדינים ברקע (זה הקטע היפה) */
.auth-page::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;

    background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                      linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);

    background-size: 40px 40px;
}

/* 🔥 הכרטיס עצמו */
#container {
    background: #111827;

    padding: 30px;
    border-radius: 16px;

    box-shadow: 0 10px 40px rgba(0,0,0,0.5);

    width: 100%;
    max-width: 350px;

    position: relative;
    z-index: 1;
}
#container h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 1px; /* ריווח בין אותיות = נראה יוקרתי */
    text-align: center;
    margin-bottom: 25px;
}
#container h2 {
    color: #ffffff;
    font-size: 22px;
    font-weight: 500;
    letter-spacing: 1px; /* ריווח בין אותיות = נראה יוקרתי */
    text-align: center;
    margin-bottom: 25px;
}
button {
    width: 100%;
    max-width: 300px;

    padding: 13px;
    margin-top: 12px;

    border-radius: 12px;
    border: 1px solid #2a2f45;

    background: #111827; /* כהה נקי */
    color: #e5e7eb;

    font-size: 14px;
    font-weight: 500;

    cursor: pointer;

    transition: all 0.2s ease;
}

/* 🔥 התחברות = כפתור ראשי */
#loginBtn {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border: none;

    position: relative;
    overflow: hidden;

    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);

    transition: all 0.25s ease;
}

/* 🔥 אפקט אור שעובר על הכפתור */
#loginBtn::before {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;

    background: linear-gradient(
        120deg,
        transparent,
        rgba(255,255,255,0.3),
        transparent
    );

    transition: 0.5s;
}

/* כשעוברים עם העכבר */
#loginBtn:hover::before {
    left: 100%;
}

/* hover רגיל */
#loginBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.5);
}

/

/* 🔹 הרשמה = כפתור יוקרתי עדין */
#registerBtn {
    background: transparent;
    border: 1px solid #374151;
    color: #9ca3af;
}

/* hover הרשמה */
#registerBtn:hover {
    background: #1f2937;
    color: #ffffff;
    border-color: #4b5563;
}
/* מצב טעינה */
#loginBtn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* העיגול המסתובב */
#loginBtn.loading::after {
    content: "";
    width: 16px;
    height: 16px;

    border: 2px solid rgba(255,255,255,0.5);
    border-top: 2px solid #fff;

    border-radius: 50%;

    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);

    animation: spin 0.7s linear infinite;
}

/* אנימציה */
@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}
#topMenu{
    position:fixed;
    top:0;
    left:0;
    width:100%;
    height:40px;
    background:#e9e9e9;
    border-bottom:1px solid #bfbfbf;
    direction: rtl;
    z-index:999;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

#menu{
    display:flex;
    justify-content:center;
    align-items:center;
    height:100%;
}

/* כל לינק */
#menu a{
    text-decoration:none;
    color:#333;
    font-size:14px;
    padding:6px 14px;
    border-left:1px solid #ccc;
    transition:0.2s;
}

/* שלא יהיה קו על האחרון */
#menu a:last-child{
    border-left:none;
}

/* hover כמו פעם */
#menu a:hover{
    background:#dcdcdc;
    color:#000;
}

/* דף פעיל */
#menu a.active{
    background:#ffffff;
    font-weight:bold;
    border-bottom:2px solid #3498db;
}