/**
 * PublicChatWidget Styles
 * 
 * Design: Transparent bakgrund, 90-graders hörn, Quicksand font
 * Färger: Xcocar grön (#778E8C)
 */

/* ============================================
   FLOATING BUTTON
   ============================================ */
.xcocar-chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  background-color: #778E8C;
  color: white;
  border: none;
  border-radius: 0; /* 90-graders hörn */
  cursor: pointer;
  font-size: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: background-color 0.3s ease, transform 0.2s ease;
  z-index: 9999;
  font-family: 'Quicksand', sans-serif;
}

.xcocar-chat-toggle:hover {
  background-color: #6a7f7d;
  transform: scale(1.05);
}

.xcocar-chat-toggle:active {
  transform: scale(0.95);
}

/* ============================================
   CHAT WINDOW
   ============================================ */
.xcocar-chat-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 420px;
  max-width: calc(100vw - 48px);
  height: 650px;
  max-height: calc(100vh - 140px);
  background-color: rgba(255, 255, 255, 0.85); /* Mer transparent bakgrund */
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 0; /* 90-graders hörn */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  z-index: 9998;
  font-family: 'Quicksand', sans-serif;
}

/* ============================================
   HEADER
   ============================================ */
.xcocar-chat-header {
  background-color: #778E8C;
  color: white;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 0; /* 90-graders hörn */
}

.xcocar-chat-header-content {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 600;
}

.xcocar-chat-header-content i {
  font-size: 24px;
}

.xcocar-chat-close {
  background: none;
  border: none;
  color: white;
  font-size: 28px;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s ease;
}

.xcocar-chat-close:hover {
  opacity: 0.8;
}

/* ============================================
   BODY
   ============================================ */
.xcocar-chat-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px;
}

/* ============================================
   INFO BOX
   ============================================ */
.xcocar-chat-info {
  background-color: rgba(59, 130, 246, 0.1);
  border-left: 3px solid #3b82f6;
  padding: 12px;
  margin-bottom: 16px;
  display: flex;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  border-radius: 0; /* 90-graders hörn */
}

.xcocar-chat-info i {
  color: #3b82f6;
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.xcocar-chat-info p {
  margin: 0;
  color: #1e293b;
}

.xcocar-chat-info strong {
  color: #778E8C;
  font-weight: 600;
}

/* ============================================
   CONTACT FORM
   ============================================ */
.xcocar-contact-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  max-height: 100%;
}

.xcocar-form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.xcocar-form-group label {
  font-size: 14px;
  font-weight: 600;
  color: #334155;
}

.xcocar-form-group small {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
  display: block;
  margin-top: 2px;
}

.xcocar-form-group input,
.xcocar-form-group textarea {
  padding: 12px 14px;
  border: 2px solid rgba(119, 142, 140, 0.3);
  border-radius: 0; /* 90-graders hörn */
  font-size: 14px;
  font-family: 'Quicksand', sans-serif;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: rgba(255, 255, 255, 0.9);
}

.xcocar-form-group input:focus,
.xcocar-form-group textarea:focus {
  outline: none;
  border-color: #778E8C;
  box-shadow: 0 0 0 3px rgba(119, 142, 140, 0.15);
  background-color: rgba(255, 255, 255, 1);
}

.xcocar-form-group textarea {
  resize: vertical;
  min-height: 100px;
}

/* ============================================
   BUTTONS
   ============================================ */
.xcocar-btn-primary {
  background-color: #778E8C; /* Xcocar grön */
  color: white;
  border: none;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Quicksand', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 0; /* 90-graders hörn */
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.xcocar-btn-primary:hover {
  background-color: #6a7f7d;
}

.xcocar-btn-primary:active {
  transform: scale(0.98);
}

.xcocar-btn-primary:disabled {
  background-color: #94a3b8;
  cursor: not-allowed;
  transform: none;
}

/* ============================================
   MESSAGES AREA
   ============================================ */
.xcocar-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 0;
  margin-bottom: 16px;
}

/* Custom scrollbar */
.xcocar-messages::-webkit-scrollbar {
  width: 6px;
}

.xcocar-messages::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.05);
  border-radius: 0;
}

.xcocar-messages::-webkit-scrollbar-thumb {
  background: #778E8C;
  border-radius: 0;
}

.xcocar-messages::-webkit-scrollbar-thumb:hover {
  background: #6a7f7d;
}

/* ============================================
   MESSAGE BUBBLES
   ============================================ */
.xcocar-message {
  display: flex;
  flex-direction: column;
  max-width: 80%;
  word-wrap: break-word;
}

.xcocar-message-customer {
  align-self: flex-end;
  align-items: flex-end;
}

.xcocar-message-seller {
  align-self: flex-start;
  align-items: flex-start;
}

.xcocar-message-sender {
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  margin-bottom: 4px;
}

.xcocar-message-content {
  padding: 10px 14px;
  border-radius: 0; /* 90-graders hörn */
  font-size: 14px;
  line-height: 1.5;
}

.xcocar-message-customer .xcocar-message-content {
  background-color: #778E8C;
  color: white;
}

.xcocar-message-seller .xcocar-message-content {
  background-color: #f1f5f9;
  color: #1e293b;
}

.xcocar-message-time {
  font-size: 11px;
  color: #94a3b8;
  margin-top: 4px;
}

/* ============================================
   INPUT AREA
   ============================================ */
.xcocar-input-container {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  padding: 12px;
  background-color: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid rgba(119, 142, 140, 0.2);
}

.xcocar-input-container textarea {
  flex: 1;
  padding: 12px 14px;
  border: 2px solid rgba(119, 142, 140, 0.3);
  border-radius: 0; /* 90-graders hörn */
  font-size: 14px;
  font-family: 'Quicksand', sans-serif;
  resize: none;
  min-height: 60px;
  max-height: 120px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: rgba(255, 255, 255, 0.9);
}

.xcocar-input-container textarea:focus {
  outline: none;
  border-color: #778E8C;
  box-shadow: 0 0 0 3px rgba(119, 142, 140, 0.15);
  background-color: rgba(255, 255, 255, 1);
}

.xcocar-btn-send {
  background-color: #778E8C;
  color: white;
  border: none;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  border-radius: 0; /* 90-graders hörn */
  transition: background-color 0.3s ease, transform 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(119, 142, 140, 0.3);
}

.xcocar-btn-send:hover {
  background-color: #6a7f7d;
  transform: scale(1.05);
}

.xcocar-btn-send:active {
  transform: scale(0.95);
}

.xcocar-btn-send i {
  font-size: 20px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
  .xcocar-chat-window {
    right: 8px;
    bottom: 80px;
    width: calc(100vw - 16px);
    height: calc(100vh - 120px);
  }
  
  .xcocar-chat-toggle {
    right: 8px;
    bottom: 8px;
  }
}

@media (max-width: 480px) {
  .xcocar-chat-window {
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    border-radius: 0;
  }
  
  .xcocar-chat-toggle {
    right: 16px;
    bottom: 16px;
  }
}
