/* Support Dashboard Layout */
.support-dashboard {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: calc(100vh - 180px); /* Adjust based on header/nav */
  overflow: hidden;
  background: #f8f9fa;
  padding: 10px;
  border-radius: 12px;
}

/* Stats Row */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  flex-shrink: 0;
}

.stat-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  display: flex;
  align-items: center;
  gap: 16px;
  border: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.stat-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.stat-info {
  flex: 1;
}

.stat-label {
  font-size: 13px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: #1e293b;
}

/* Main Content Split View */
.support-content {
  display: flex;
  gap: 20px;
  flex: 1;
  min-height: 0; /* Important for scrolling */
}

/* Left Column: Ticket List */
.ticket-list-panel {
  width: 380px;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  border: none;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}

.list-header {
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
}

.search-bar {
  position: relative;
}

.search-input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 14px;
  background: #f8fafc;
  transition: all 0.3s ease;
}

.search-input:focus {
  border-color: #6366f1;
  background: white;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
  outline: none;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  font-size: 20px;
}

.tickets-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ticket-card-mini {
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #f1f5f9;
  background: white;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.ticket-card-mini:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  border-color: #cbd5e1;
}

.ticket-card-mini.active {
  background: #f0fdfa; /* Soft teal background */
  border-color: #2dd4bf;
  box-shadow: 0 4px 12px rgba(45, 212, 191, 0.2);
}

.ticket-card-mini.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: #0d9488;
}

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

.mini-subject {
  font-weight: 700;
  font-size: 15px;
  color: #1e293b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 180px;
}

.mini-status {
  font-size: 10px;
  padding: 4px 8px;
  border-radius: 20px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.mini-user {
  font-size: 13px;
  color: #475569;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.mini-date {
  font-size: 11px;
  color: #94a3b8;
  display: flex;
  justify-content: flex-end;
}

/* Right Column: Ticket Details */
.ticket-details-panel {
  flex: 1;
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.05);
  border: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-selection {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #94a3b8;
  background: #f8fafc;
}

.details-header {
  padding: 24px;
  border-bottom: 1px solid #f1f5f9;
  background: white;
}

.details-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.details-subject {
  font-size: 24px;
  font-weight: 800;
  color: #1e293b;
  line-height: 1.3;
}

.details-meta-row {
  display: flex;
  gap: 24px;
  font-size: 13px;
  color: #64748b;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
}

.meta-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
}

/* Chat Area */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: #f1f5f9;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.message-bubble {
  max-width: 85%;
  padding: 18px 24px;
  border-radius: 16px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  line-height: 1.6;
}

.message-bubble.user {
  align-self: flex-start;
  background: white;
  border-bottom-left-radius: 4px;
  border: 1px solid #e2e8f0;
}

.message-bubble.admin {
  align-self: flex-end;
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.message-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  opacity: 0.8;
}

.sender-name {
  font-weight: 700;
}

.message-time {
  font-size: 11px;
}

.message-text {
  font-size: 15px;
  white-space: pre-wrap;
}

/* Reply Box */
.reply-box {
  padding: 24px;
  background: white;
  border-top: 1px solid #f1f5f9;
}

.reply-header {
  font-size: 14px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.reply-input {
  width: 100%;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  font-size: 15px;
  resize: vertical;
  min-height: 100px;
  margin-bottom: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.reply-input:focus {
  outline: none;
  border-color: #6366f1;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.reply-actions {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
}

/* Status Badges */
.status-badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.status-badge.open { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.status-badge.in-progress { background: #fef3c7; color: #d97706; border: 1px solid #fcd34d; }
.status-badge.closed, .status-badge.resolved { background: #dcfce7; color: #166534; border: 1px solid #86efac; }

/* Responsive */
@media (max-width: 900px) {
  .support-content {
    flex-direction: column;
    height: auto;
    overflow: visible;
  }
  
  .ticket-list-panel {
    width: 100%;
    height: 350px;
  }
  
  .ticket-details-panel {
    height: 600px;
  }
}