/* Modern & Professional Styling */
:root {
  font-family: 'Inter', system-ui, Avenir, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-weight: 400;
  color-scheme: light dark;
  color: #2c3e50;
  background-color: #f7f9fc;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: #2563eb;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s;
}

a:hover {
  color: #1e40af;
}

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: url('/assets/contact_center_background.png') no-repeat center center fixed;
  background-size: cover;
  position: relative;
}

body::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(247, 249, 252, 0.8);
  z-index: -1;
}

#app {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 2rem;
  background: white;
  border-radius: 14px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo {
  height: 65px;
  margin-bottom: 1.2rem;
}

/* Status Styling */
#status {
  padding: 14px 24px;
  margin-bottom: 20px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 1rem;
  background-color: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
}

.connected {
  background-color: #ecfdf5;
  color: #065f46;
  border-color: #34d399;
}

.disconnected {
  background-color: #fefce8;
  color: #df7687;
  border-color: #facc15;
}

.error {
  background-color: #fef2f2;
  color: #df7687;
  border-color: #df7687;
}

/* Chat Container */
#chat-container {
  width: 100%;
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background-color: #f1f5f9;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border: 1px solid #e2e8f0;
}

/* Messages Styling */
.message {
  padding: 16px 20px;
  border-radius: 18px;
  max-width: 75%;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.06);
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 1rem;
  transition: transform 0.2s ease;
}

.user {
  background-color: #41afe0;
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 6px;
}

.assistant {
  background-color: #4db89e;
  color: #fff;
  align-self: flex-start;
  border-bottom-left-radius: 6px;
}

.system {
  background-color: #e0f2fe;
  color: #334155;
  font-style: italic;
  align-self: center;
  padding: 10px 14px;
  font-size: 0.9rem;
  max-width: 85%;
  border-radius: 12px;
  border: 1px solid #bae6fd;
}

.role-label {
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.7;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.conversation-end {
  background-color: #e5e7eb;
  color: #374151;
  padding: 10px 20px;
  border-radius: 20px;
  text-align: center;
  max-width: 60%;
  font-size: 0.95em;
  align-self: center;
}

/* Controls Styling */
#controls {
  position: relative;
  padding: 20px;
  background-color: none;
  display: flex;
  justify-content: center;
  gap: 14px;
  z-index: 100;
}

button,
.button {
  border: none;
  border-radius: 10px;
  padding: 12px 24px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

#start {
  background-color: #4db89e;
  color: white;
}

#start:hover {
  background-color: #4db89e;
  transform: scale(1.03);
}

#stop {
  background-color: #df7687;
  color: white;
}

#stop:hover {
  background-color: #df7687;
  transform: scale(1.03);
}

button:disabled,
.button:disabled {
  background-color: #cbd5e1;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Responsive Design */
@media (max-width: 768px) {
  #app {
    padding: 1.5rem;
  }
  .message {
    max-width: 90%;
  }
}

@media (max-width: 580px) {
  .logo {
    height: 50px;
  }
  #controls {
    flex-direction: column;
    padding: 12px;
  }
}
