:root {
  --primary-gradient: linear-gradient(
    135deg,
    rgba(64, 158, 255, 0.9) 0%,
    rgba(32, 101, 189, 0.7) 100%
  );
  --client-gradient: linear-gradient(
    135deg,
    rgba(45, 183, 220, 0.9) 0%,
    rgba(16, 125, 175, 0.7) 100%
  );
  --advisor-gradient: linear-gradient(
    135deg,
    rgba(120, 75, 220, 0.9) 0%,
    rgba(78, 41, 150, 0.7) 100%
  );
  --system-gradient: linear-gradient(
    135deg,
    rgba(170, 170, 170, 0.9) 0%,
    rgba(100, 100, 100, 0.7) 100%
  );
  --pm-gradient: linear-gradient(
    135deg,
    rgba(255, 159, 67, 0.95) 0%,
    rgba(214, 98, 20, 0.8) 100%
  );
  --tech-blue: rgba(0, 122, 255, 0.15);
  --tech-purple: rgba(88, 86, 214, 0.15);
  --text-primary: #333;
  --text-secondary: #666;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --border-radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    "SF Pro Display",
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Oxygen,
    Ubuntu,
    Cantarell,
    "Open Sans",
    "Helvetica Neue",
    sans-serif;
}

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 30px;
}

.panel {
  background: var(--bg-secondary);
  border-radius: var(--border-radius);
  padding: 30px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.input-panel {
  display: flex;
  flex-direction: column;
}

.title-bar {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
}

.logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--primary-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
}

.logo i {
  font-size: 1.5rem;
  color: white;
}

h1 {
  font-size: 1.8rem;
  font-weight: 600;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.format-indicator {
  margin-top: 10px;
  padding: 10px 15px;
  background: rgba(64, 158, 255, 0.1);
  border-radius: 12px;
  font-size: 0.9rem;
  color: #1976d2;
  display: none;
}

textarea {
  height: 8em;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 12px;
  color: var(--text-primary);
  padding: 20px;
  font-family: monospace;
  font-size: 15px;
  resize: none;
  margin-bottom: 25px;
  transition: all 0.3s ease;
  line-height: 1.5;
}

textarea:focus {
  outline: none;
  border-color: rgba(64, 158, 255, 0.5);
  box-shadow: 0 0 0 3px rgba(64, 158, 255, 0.1);
}

.button-group {
  display: flex;
  gap: 15px;
}

button {
  flex: 1;
  padding: 16px;
  border: none;
  border-radius: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 16px;
  position: relative;
  overflow: hidden;
}

.process-btn {
  background: var(--primary-gradient);
  color: white;
}

.clear-btn {
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

button::after {
  content: "";
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

button:hover::after {
  opacity: 1;
}

.process-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(64, 158, 255, 0.3);
}

.clear-btn:hover {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-primary);
}

.notification {
  margin-top: 20px;
  padding: 15px;
  border-radius: 12px;
  background: rgba(255, 71, 87, 0.1);
  border: 1px solid rgba(255, 71, 87, 0.2);
  display: none;
  font-size: 14px;
  color: #d32f2f;
}

.display-panel {
  overflow-y: auto;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.display-panel::-webkit-scrollbar {
  display: none;
}

.advisor-header {
  display: flex;
  align-items: center;
  margin-bottom: 40px;
  background: var(--bg-secondary);
  border-radius: 14px;
  padding: 20px;
  border-left: 4px solid #7e4bdc;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.advisor-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--advisor-gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin-right: 20px;
}

.advisor-info h2 {
  font-size: 26px;
  margin-bottom: 8px;
  background: var(--advisor-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.advisor-info p {
  color: var(--text-secondary);
  font-size: 16px;
}

.conversations {
  display: flex;
  flex-direction: column;
  gap: 45px;
}

.conversation-block {
  position: relative;
}

.conversation-header {
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  padding-left: 15px;
  border-left: 3px solid #2db7dc;
}

.conversation-header h3 {
  font-size: 22px;
  color: #2db7dc;
}

.conversation-header span {
  margin-left: 10px;
  background: rgba(45, 183, 220, 0.15);
  color: #a2dff0;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
}

.messages-container {
  display: flex;
  flex-direction: column;
  gap: 25px;
}

.message {
  max-width: 75%;
  padding: 18px 25px;
  border-radius: 20px;
  position: relative;
  animation: messageAppear 0.4s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.client {
  align-self: flex-start;
  border-bottom-left-radius: 5px;
  background: var(--client-gradient);
  box-shadow: 0 8px 20px rgba(16, 125, 175, 0.2);
  color: white;
}

.advisor {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: var(--advisor-gradient);
  box-shadow: 0 8px 20px rgba(78, 41, 150, 0.2);
  color: white;
}

.system {
  align-self: center;
  text-align: center;
  margin: 15px auto;
  max-width: 80%;
  background: var(--system-gradient);
  box-shadow: 0 8px 20px rgba(100, 100, 100, 0.2);
  color: white;
}

.pm {
  align-self: flex-end;
  border-bottom-right-radius: 5px;
  background: var(--pm-gradient);
  box-shadow: 0 8px 20px rgba(214, 98, 20, 0.25);
  color: white;
}

.pm-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  margin-right: 6px;
  vertical-align: middle;
}

.message-time {
  font-size: 12px;
  opacity: 0.6;
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.message-text {
  line-height: 1.5;
  font-size: 16px;
  white-space: pre-wrap;
  word-break: break-word;
}

.visual-asset {
  position: absolute;
  width: 200px;
  height: 200px;
  z-index: -1;
  opacity: 0.05;
  background: linear-gradient(
    135deg,
    rgba(120, 75, 220, 1),
    rgba(45, 183, 220, 1)
  );
  border-radius: 50%;
  filter: blur(60px);
}

.visual-asset:nth-child(1) {
  top: 10%;
  right: 20%;
}

.visual-asset:nth-child(2) {
  bottom: 15%;
  left: 15%;
  width: 180px;
  height: 180px;
  background: linear-gradient(
    135deg,
    rgba(0, 122, 255, 1),
    rgba(32, 101, 189, 1)
  );
}

.visual-line {
  position: absolute;
  z-index: -1;
  opacity: 0.03;
}

@keyframes messageAppear {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.appear {
  animation: fadeInUp 0.8s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}

.appear-delay-1 {
  animation-delay: 0.1s;
}

.appear-delay-2 {
  animation-delay: 0.2s;
}

/* Timeline connector for system messages */
.messages-container {
  position: relative;
}

.messages-container::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background: linear-gradient(
    to bottom,
    rgba(77, 171, 255, 0.1),
    transparent,
    rgba(255, 107, 155, 0.1)
  );
  transform: translateX(-50%);
  z-index: -1;
}

/* Legend */
.legend {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin: 20px 0;
}

.stats-bar {
  display: flex;
  gap: 15px;
  margin: 25px 0 35px;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 140px;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.stat-num {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  background: var(--advisor-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.legend-color {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  margin-right: 8px;
}

.legend-client {
  background: var(--client-gradient);
}

.legend-advisor {
  background: var(--advisor-gradient);
}

.legend-system {
  background: var(--system-gradient);
}

.legend-pm {
  background: var(--pm-gradient);
}

.client .message-time,
.advisor .message-time,
.system .message-time,
.pm .message-time {
  color: rgba(255, 255, 255, 0.8);
}
