* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px;
}

.app-container {
  display: flex;
  gap: 20px;
  width: 100%;
  max-width: 1100px;
  height: 90vh;
}

.chat-container {
  flex: 1;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.chat-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 15px;
  text-align: center;
}

.chat-header h1 {
  font-size: 1.3rem;
  margin-bottom: 5px;
}

.chat-header p {
  font-size: 0.85rem;
  opacity: 0.9;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 15px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.message {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 16px;
  line-height: 1.4;
  font-size: 0.95rem;
}

.message.user {
  background: #667eea;
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  background: #f0f0f0;
  color: #333;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message.loading {
  background: #f0f0f0;
  color: #999;
  font-style: italic;
}

.chat-input {
  display: flex;
  padding: 15px;
  border-top: 1px solid #eee;
  gap: 10px;
}

.chat-input input {
  flex: 1;
  padding: 12px 16px;
  border: 2px solid #eee;
  border-radius: 25px;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.3s;
  min-width: 0;
}

.chat-input input:focus {
  border-color: #667eea;
}

.chat-input button {
  padding: 12px 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  white-space: nowrap;
}

.chat-input button:hover {
  transform: scale(1.05);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.chat-input button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Bookings Panel */
.bookings-container {
  width: 320px;
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.bookings-header {
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  padding: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.bookings-header h2 {
  font-size: 1.2rem;
}

.bookings-header button {
  padding: 8px 14px;
  background: rgba(255,255,255,0.2);
  color: white;
  border: none;
  border-radius: 15px;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 0.85rem;
}

.bookings-header button:hover {
  background: rgba(255,255,255,0.3);
}

.bookings-list {
  flex: 1;
  overflow-y: auto;
  padding: 12px;
}

.booking-card {
  background: #f8f9fa;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  border-left: 4px solid #11998e;
}

.booking-card .date {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  font-size: 0.9rem;
}

.booking-card .time {
  color: #11998e;
  font-size: 1rem;
  font-weight: bold;
}

.booking-card .patient {
  color: #666;
  margin-top: 6px;
  font-size: 0.9rem;
}

.booking-card .phone {
  color: #999;
  font-size: 0.85rem;
}

.no-bookings {
  text-align: center;
  color: #999;
  padding: 30px 15px;
}

.loading {
  text-align: center;
  color: #999;
  padding: 30px 15px;
}

/* Toggle button for mobile */
.toggle-bookings {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
  color: white;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  z-index: 1000;
}

/* RESPONSIVE - Tablette */
@media (max-width: 900px) {
  .app-container {
    flex-direction: column;
    height: auto;
    min-height: 100vh;
  }

  .chat-container {
    height: 60vh;
    border-radius: 15px;
  }

  .bookings-container {
    width: 100%;
    height: 35vh;
    border-radius: 15px;
  }
}

/* RESPONSIVE - Smartphone */
@media (max-width: 600px) {
  body {
    padding: 0;
    align-items: flex-start;
  }

  .app-container {
    flex-direction: column;
    gap: 0;
    height: 100vh;
    max-width: 100%;
  }

  .chat-container {
    height: 100vh;
    border-radius: 0;
    position: relative;
  }

  .chat-header {
    padding: 12px;
  }

  .chat-header h1 {
    font-size: 1.1rem;
  }

  .chat-header p {
    font-size: 0.75rem;
  }

  .chat-messages {
    padding: 10px;
    gap: 10px;
  }

  .message {
    max-width: 90%;
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .chat-input {
    padding: 10px;
    gap: 8px;
  }

  .chat-input input {
    padding: 10px 14px;
    font-size: 0.95rem;
  }

  .chat-input button {
    padding: 10px 16px;
    font-size: 0.9rem;
  }

  /* Cacher le panel RDV par défaut sur mobile */
  .bookings-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    border-radius: 0;
    z-index: 999;
  }

  .bookings-container.active {
    display: flex;
  }

  .bookings-header {
    padding: 12px;
  }

  .bookings-header h2 {
    font-size: 1.1rem;
  }

  /* Bouton pour afficher les RDV */
  .toggle-bookings {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Bouton fermer dans le panel */
  .close-bookings {
    display: block;
    padding: 8px 14px;
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    font-size: 0.85rem;
  }
}