/* ================================
   SUPPORT PAGE STYLES
   ================================ */

.support-section {
  margin-bottom: 32px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.section-header h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ticket-count {
  background: var(--accent-primary);
  color: #000;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 20px;
}

/* Ticket Form */
.ticket-form-card {
  padding: 24px;
}

.ticket-form .form-group {
  margin-bottom: 20px;
}

.ticket-form label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-select,
.form-textarea {
  width: 100%;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

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

.form-select option {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* Tickets List */
.tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--bg-secondary);
  border-radius: 16px;
  border: 1px dashed var(--border-color);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Ticket Item */
.ticket-item {
  background: var(--bg-secondary);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  padding: 16px 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.ticket-item:hover {
  border-color: var(--accent-primary);
  transform: translateY(-2px);
}

.ticket-item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.ticket-item-title {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 1rem;
}

.ticket-item-id {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.ticket-item-preview {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ticket-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

/* Ticket Status Badges */
.ticket-status {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
}

.ticket-status.open {
  background: rgba(59, 130, 246, 0.2);
  color: #60a5fa;
}

.ticket-status.answered {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

.ticket-status.closed {
  background: rgba(107, 114, 128, 0.2);
  color: #9ca3af;
}

.ticket-status.pending {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
}

/* Unread indicator */
.ticket-item.unread {
  border-left: 3px solid var(--accent-primary);
}

.ticket-item.unread .ticket-item-title::after {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
  border-radius: 50%;
  margin-left: 8px;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.ticket-modal {
  background: var(--bg-primary);
  border-radius: 16px;
  border: 1px solid var(--border-color);
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.ticket-info {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.ticket-id {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
}

.ticket-date {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-left: auto;
}

/* Conversation */
.ticket-conversation {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  max-height: 300px;
  overflow-y: auto;
}

.message {
  padding: 12px 16px;
  border-radius: 12px;
  max-width: 85%;
}

.message.user {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.message.support {
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.15), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(168, 85, 247, 0.3);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.message-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.message-author {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.message.support .message-author {
  color: var(--accent-primary);
}

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

.message-text {
  font-size: 0.95rem;
  color: var(--text-primary);
  line-height: 1.5;
}

/* Reply Section */
.ticket-reply {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
}

.ticket-reply .form-textarea {
  min-height: 80px;
}

.ticket-reply .btn {
  align-self: flex-end;
}

/* Hidden when ticket is closed */
.ticket-reply.hidden {
  display: none;
}

/* Mobile Responsive */
@media (max-width: 768px) {
  .ticket-form-card {
    padding: 16px;
  }
  
  .ticket-item {
    padding: 14px 16px;
  }
  
  .ticket-info {
    flex-wrap: wrap;
  }
  
  .ticket-date {
    width: 100%;
    margin-left: 0;
    margin-top: 8px;
  }
  
  .ticket-modal {
    max-height: 90vh;
  }
  
  .modal-body {
    padding: 16px;
  }
  
  .message {
    max-width: 95%;
  }
}
