@import url('https://fonts.googleapis.com/css2?family=Orbitron&display=swap');

/* ✅ כפתור פתיחת הצ'אט */
#chatToggle {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 70px;
  height: 70px;
  background: radial-gradient(circle, #ff1a1a, #cc0000);
  border: 3px solid #ff4d4d;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(255, 0, 0, 0.7);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 1000;
}

#chatToggle:hover {
  transform: scale(1.2) rotate(15deg);
  box-shadow: 0 0 30px rgba(255, 0, 0, 0.9);
}

/* ✅ חלון הצ'אט */
#chatWidget {
  position: fixed;
  bottom: 110px;
  right: 30px;
  width: 320px;
  height: 450px;
  background: #fff;
  border: 3px solid #ff1a1a;
  border-radius: 15px;
  box-shadow: 0 0 25px rgba(255, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.5s ease-in-out;
  z-index: 1001;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

#chatHeader {
  background: linear-gradient(90deg, #ff1a1a, #cc0000);
  color: #fff;
  padding: 12px;
  text-align: center;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
  font-size: 1.1em;
  border-bottom: 2px solid #ff4d4d;
}

#closeButton {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  font-size: 1.5em;
  color: #fff;
  transition: color 0.3s;
}
#closeButton:hover { color: #ff4d4d; }

#chatMessages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
  background: #fff;
}





/* ✅ הודעות */
.message {
  margin-bottom: 15px;
  padding: 10px;
  background: #f8f8f8;
  border-left: 5px solid #ff1a1a;
  border-radius: 10px;
  animation: slideIn 0.3s ease-in-out;}

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.user-info {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  margin-bottom: 5px;
}

.user-photo {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ff4d4d;
  box-shadow: 0 0 5px rgba(255, 0, 0, 0.3);
}

.sender {
  font-weight: bold;
  color: #ff4d4d;
  text-shadow: 0 0 5px #ff4d4d;
}

.message-content {
  display: flex;
  flex-direction: column;
margin-right: auto;
  gap: 0px;
}

.text {
  color: #333;
  margin: 0;
  max-width: 100%;
  border-left: 2px;
margin-left: auto;
  padding-left: 10px;
  padding-bottom: 5px;
}

.timestamp {
  font-size: 0.6em;
  color: #666;
  margin-left: auto ;
}
#chatMessages {
  flex-grow: 1;
  overflow-y: auto; 
  padding: 15px;
  background: #fff;
  max-height: 100%; 
    padding-bottom: 30px; /* ✅ רווח קטן בתחתית, ניתן לשנות ל-20px */
  box-sizing: border-box; /* ✅ כדי שהpadding לא יגדיל את הגובה */
  text-align:left ;
}

/* ✅ ניווט עליון (לוגין וכו') */
#navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: #ff1a1a;
  color: black;
}

#navbar h1 {
  margin: 0;
  font-size: 20px;
}

#login-btn {
  background: white;
  color: #ff1a1a;
  border: none;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}
#login-btn:hover { opacity: 0.9; }
@media (max-width: 600px) {
  #chatWidget {
    width: 90vw;
    height: 70vh;
    right: 5vw;
    bottom: 100px;
  }
  #chatToggle {
    width: 55px;
    height: 55px;
    bottom: 20px;
    right: 20px;
  }
  .user-photo {
    width: 30px;
    height: 30px;
  }
  .sender {
    font-size: 0.9em;
  }
  .text {
    font-size: 0.9em;
  }
}