/* ========================================
   SUPPORT SYSTEM - Chat & Tickets Styles
   ======================================== */

/* ========================================
   FLOATING SUPPORT BUTTON
   ======================================== */
#support-button {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  border: none;
  cursor: pointer;
  font-size: 1.5rem;
  box-shadow: var(--shadow-xl);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
}

#support-button:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-purple-blue);
}

#support-button .notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  width: 20px;
  height: 20px;
  background: #ef4444;
  border-radius: 50%;
  color: white;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid white;
}

/* ========================================
   SUPPORT MODAL
   ======================================== */
.support-modal {
  position: fixed;
  bottom: 6rem;
  right: 1.5rem;
  width: 90%;
  max-width: 400px;
  background: var(--bg-primary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  z-index: 1000;
  overflow: hidden;
  transform: translateY(20px);
  opacity: 0;
  animation: slideUp 0.3s ease-out forwards;
}

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

.support-modal-header {
  background: var(--gradient-primary);
  color: white;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.support-modal-header h3 {
  font-size: 1.125rem;
  font-weight: 700;
  margin: 0;
}

.support-modal-close {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.support-modal-close:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* ========================================
   SUPPORT MENU (Main Options)
   ======================================== */
.support-menu {
  padding: 1.5rem;
}

.support-option {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.support-option:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  transform: translateX(4px);
}

.support-option-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.support-option-content h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem 0;
}

.support-option-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ========================================
   LIVE CHAT
   ======================================== */
.chat-container {
  display: flex;
  flex-direction: column;
  height: 500px;
}

.chat-messages {
  flex: 1;
  padding: 1rem;
  overflow-y: auto;
  background: var(--bg-secondary);
}

.chat-message {
  display: flex;
  margin-bottom: 1rem;
  animation: fadeInUp 0.3s ease-out;
}

.chat-message.user {
  flex-direction: row-reverse;
}

.chat-message-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.chat-message-content {
  margin: 0 0.75rem;
  max-width: 70%;
}

.chat-message-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-sm);
}

.chat-message.user .chat-message-bubble {
  background: var(--gradient-primary);
  color: white;
}

.chat-message-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.chat-input-container {
  padding: 1rem;
  background: var(--bg-primary);
  border-top: 1px solid var(--primary-100);
  display: flex;
  gap: 0.5rem;
}

.chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  transition: border-color 0.2s;
}

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

.chat-send-button {
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.chat-send-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

/* ========================================
   TICKET SYSTEM
   ======================================== */
.ticket-form {
  padding: 1.5rem;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary-500);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-button {
  width: 100%;
  padding: 0.875rem 1.5rem;
  background: var(--gradient-primary);
  color: white;
  border: none;
  border-radius: var(--radius-lg);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.form-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

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

/* ========================================
   TICKET LIST
   ======================================== */
.ticket-list {
  padding: 1rem;
  max-height: 450px;
  overflow-y: auto;
}

.ticket-item {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 1rem;
  margin-bottom: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}

.ticket-item:hover {
  background: var(--primary-50);
  border-color: var(--primary-200);
  transform: translateX(4px);
}

.ticket-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.ticket-id {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
}

.ticket-status {
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.ticket-status.open {
  background: #dbeafe;
  color: #1e40af;
}

.ticket-status.in-progress {
  background: #fef3c7;
  color: #92400e;
}

.ticket-status.resolved {
  background: #d1fae5;
  color: #065f46;
}

.ticket-status.closed {
  background: #f3f4f6;
  color: #6b7280;
}

.ticket-subject {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.ticket-preview {
  font-size: 0.875rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--primary-100);
}

.ticket-priority {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  font-weight: 600;
}

.ticket-priority.high {
  color: #dc2626;
}

.ticket-priority.medium {
  color: #f59e0b;
}

.ticket-priority.low {
  color: #10b981;
}

.ticket-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ========================================
   KNOWLEDGE BASE / FAQ
   ======================================== */
.kb-container {
  padding: 1.5rem;
  max-height: 450px;
  overflow-y: auto;
}

.kb-search {
  margin-bottom: 1.5rem;
}

.kb-search-input {
  width: 100%;
  padding: 0.875rem 1rem 0.875rem 3rem;
  border: 2px solid var(--primary-200);
  border-radius: var(--radius-lg);
  font-size: 0.875rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z'%3E%3C/path%3E%3C/svg%3E");
  background-size: 20px 20px;
  background-position: 12px center;
  background-repeat: no-repeat;
}

.kb-category {
  margin-bottom: 1.5rem;
}

.kb-category-title {
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.kb-category-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--gradient-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
}

.kb-article {
  padding: 0.875rem 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  margin-bottom: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.kb-article:hover {
  background: var(--primary-50);
  transform: translateX(4px);
}

.kb-article-title {
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.875rem;
}

.kb-article-arrow {
  color: var(--text-muted);
  font-size: 0.75rem;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 640px) {
  .support-modal {
    right: 0.75rem;
    left: 0.75rem;
    width: auto;
    max-width: none;
  }
  
  #support-button {
    right: 0.75rem;
  }
  
  .chat-container {
    height: 400px;
  }
}

/* ========================================
   TYPING INDICATOR
   ======================================== */
.typing-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  width: fit-content;
}

.typing-indicator span {
  width: 8px;
  height: 8px;
  background: var(--primary-400);
  border-radius: 50%;
  animation: typingBounce 1.4s infinite;
}

.typing-indicator span:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typingBounce {
  0%, 60%, 100% {
    transform: translateY(0);
  }
  30% {
    transform: translateY(-8px);
  }
}

/* ========================================
   SUCCESS MESSAGE
   ======================================== */
.success-message {
  text-align: center;
  padding: 2rem;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--gradient-success);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  margin: 0 auto 1rem;
  animation: scaleIn 0.4s ease-out;
}

@keyframes scaleIn {
  from {
    transform: scale(0);
  }
  to {
    transform: scale(1);
  }
}

.success-message h3 {
  color: var(--text-primary);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.success-message p {
  color: var(--text-secondary);
  font-size: 0.875rem;
}
