/* Chat Widget Styles - Visible & Theme-Matched */

:root {
  --chat-primary: #0d7377; /* Teal accent from project */
  --chat-dark: #1a3a52;    /* Deep blue from project */
  --chat-bg: #ffffff;
  --chat-text: #333333;
  --chat-white: #ffffff;
  --chat-border: #e0e0e0;
  --chat-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.chat-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  font-family: 'Inter', sans-serif;
  width: 350px;
  max-height: 500px;
  background: var(--chat-bg);
  border: 1px solid var(--chat-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--chat-shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.chat-widget.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.chat-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--chat-primary);
  color: var(--chat-white);
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  box-shadow: 0 4px 12px rgba(13, 115, 119, 0.3);
  transition: all 0.3s ease;
  z-index: 999;
}

.chat-toggle:hover {
  transform: scale(1.05);
  background: #0a5d60;
  box-shadow: 0 6px 16px rgba(13, 115, 119, 0.4);
}

.chat-icon {
  font-size: 24px;
}

.chat-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  line-height: 1.2;
}

.chat-header {
  background: var(--chat-dark);
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--chat-white);
}

.chat-header h3, .chat-header h4 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.chat-close {
  background: none;
  border: none;
  color: var(--chat-white);
  font-size: 20px;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.chat-close:hover {
  opacity: 1;
}

.chat-end {
  background: #ff4d4d;
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #f9f9f9;
  min-height: 300px;
}

.chat-message {
  display: flex;
  max-width: 85%;
}

.chat-message-visitor {
  align-self: flex-end;
}

.chat-message-operator {
  align-self: flex-start;
}

.message-content {
  padding: 10px 14px;
  border-radius: 18px;
  font-size: 14px;
  line-height: 1.4;
}

.chat-message-visitor .message-content {
  background: var(--chat-primary);
  color: white;
  border-bottom-right-radius: 4px;
}

.chat-message-operator .message-content {
  background: white;
  color: var(--chat-text);
  border: 1px solid var(--chat-border);
  border-bottom-left-radius: 4px;
}

.chat-message-system {
  align-self: center;
  max-width: 100%;
}

.chat-message-system .message-content {
  background: transparent;
  color: #888;
  font-size: 12px;
  text-align: center;
  font-style: italic;
}

.message-meta {
  font-size: 10px;
  margin-top: 4px;
  opacity: 0.7;
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.chat-input-area {
  padding: 15px;
  background: white;
  border-top: 1px solid var(--chat-border);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  border: 1px solid var(--chat-border);
  padding: 10px 15px;
  border-radius: 20px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.chat-input:focus {
  border-color: var(--chat-primary);
}

.chat-send {
  background: var(--chat-primary);
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.chat-send:hover {
  transform: scale(1.1);
}

/* Layout B Removed - Using Unified Structure */

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .chat-widget, .chat-container {
    width: calc(100% - 30px);
    right: 15px;
    left: 15px;
    bottom: 85px;
  }
  
  .chat-toggle {
    bottom: 15px;
    right: 15px;
    width: 55px;
    height: 55px;
  }
  
  .chat-messages {
    min-height: 250px;
  }
}

@media (max-width: 480px) {
  .chat-widget, .chat-container {
    width: calc(100% - 20px);
    right: 10px;
    left: 10px;
    bottom: 80px;
  }
  
  .chat-toggle {
    bottom: 10px;
    right: 10px;
    width: 50px;
    height: 50px;
  }
  
  .chat-label {
    font-size: 7px;
  }
  
  .chat-header h3, .chat-header h4 {
    font-size: 14px;
  }
  
  .message-content {
    font-size: 13px;
  }
  
  .chat-input {
    font-size: 14px;
    padding: 10px 12px;
  }
  
  .chat-messages {
    min-height: 200px;
    padding: 15px;
  }
}
