/* main container */
.speeddate-interface {
  background-color: #40474F;
  height: 85vh; 
  max-width: 1100px;
  margin: 2rem auto; 
  
  border-radius: 12px;
  box-shadow: 0 15px 35px rgba(0,0,0,0.4);
  
  display: flex; 
  overflow: hidden;
}

.furniture-panel {
  flex: 1; 
  background-color: #f5f1ec;
  padding: 2rem;
  
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  
  border-right: 1px solid #ccc;
  
  height: 100%; 
  overflow: hidden; 
}

/* Right side */
.chat-panel {
  flex: 2; 
  background-color: #fafafa;
  
  display: flex;
  flex-direction: column;
  
  height: 100%; 
}

/* Message box */
.chat-box {
  flex: 1; 
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  
  /* De scroll bar */
  overflow-y: auto; 
  scroll-behavior: smooth;
}

/* Input area */
.input-area {
  background-color: #fff;
  padding: 1.5rem 2rem;
  border-top: 1px solid #eee;
  flex-shrink: 0; 
}

/* other styling */
.chat-message {
  max-width: 80%;
  padding: 12px 18px;
  border-radius: 18px;
  font-size: 0.95rem;
  line-height: 1.5;
  animation: fadeIn 0.3s ease;
}

.chat-message.bot {
  background-color: #e4ded6;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.chat-message.user {
  background-color: #666c72;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.chat-message strong {
  display: block;
  font-size: 0.75rem;
  margin-bottom: 4px;
  opacity: 0.8;
  text-transform: uppercase;
}

.question-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.instruction-text {
  margin-bottom: 1rem;
  color: #888;
  font-size: 0.9rem;
  font-weight: 600;
}

.chat-btn {
  background-color: transparent;
  border: 2px solid #666c72;
  color: #666c72;
  padding: 10px 20px;
  border-radius: 25px;
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.chat-btn:hover {
  background-color: #666c72;
  color: white;
}

/* Image styling  */
.image-frame {
  position: relative;
  width: 100%;
  max-width: 300px;
  height: 300px;
  background-color: #fff;
  padding: 10px;
  border-radius: 8px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  margin-bottom: 1rem;
}

.img-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
  transition: opacity 2.5s ease-in-out;
}

#img-revealed {
  opacity: 0;
  z-index: 2;
}

.image-frame.show-reveal #img-revealed {
  opacity: 1;
}

.furniture-title {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 0.5rem;
  font-weight: 700;
}

.timer {
  font-size: 2rem;
  font-weight: 800;
  color: #d9534f;
  margin-bottom: 1rem;
  background: #fff;
  padding: 5px 15px;
  border-radius: 8px;
}

.next-button {
  margin-top: 2rem;
  background-color: white;
  border: 2px solid #40474F;
  color: #40474F;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  gap: 8px;
}

.next-button:hover {
  background-color: #40474F;
  color: white;
}

/* Scrollbar */
.chat-box::-webkit-scrollbar {
  width: 8px;
}
.chat-box::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.chat-box::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Mobile layout */
@media (max-width: 768px) {
  .speeddate-interface {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
    margin: 0;
    border-radius: 0;
  }
  
  .chat-panel {
    height: 60vh; 
  }
}

.back-link {
  background: none;
  border: none;
  color: #999; 
  font-family: 'Montserrat', sans-serif;
  font-size: 0.85rem; 
  font-weight: 600;
  margin-top: 1.5rem; 
  cursor: pointer;
  text-decoration: none;
  transition: color 0.3s ease;
  display: block; 
  margin-left: auto;
  margin-right: auto;
}

.back-link:hover {
  color: #40474F; 
  text-decoration: underline;
}

/* --- Error styling --- */
.chat-message.connection-error {
  background-color: #fff3cd; 
  border: 1px solid #ffeeba;
  color: #856404;
  padding: 15px;
  border-radius: 12px;
  animation: shake 0.5s; 
}

.error-content {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 10px;
}

.error-mini-img {
  width: 60px;
  height: 60px;
  border-radius: 50%; 
  object-fit: cover;
  border: 3px solid #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  filter: grayscale(100%); 
}

.error-text {
  font-style: italic;
  font-weight: 600;
  font-size: 1rem;
}

@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  50% { transform: translateX(5px); }
  75% { transform: translateX(-5px); }
  100% { transform: translateX(0); }
}