/* reports.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #5B21B6;
  --primary-light: #7C3AED;
  --primary-dark: #4C1D95;
  --secondary: #F97316;
  --secondary-light: #FB923C;
  --text-dark: #111827;
  --text-muted: #6B7280;
  --text-light: #9CA3AF;
  --white: #FFFFFF;
  --bg-page: #F8FAFC;
  --success: #10B981;
  --warning: #F59E0B;
  --error: #DC2626;
  --border-light: #E5E7EB;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --transition: all 0.25s cubic-bezier(0.2, 0.9, 0.4, 1.1);
  
  --status-submitted: #3B82F6;
  --status-under_review: #F59E0B;
  --status-resolved: #10B981;
  --status-closed: #6B7280;
  --status-rejected: #DC2626;
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-page);
  color: var(--text-dark);
  overflow-x: hidden;
}

.app-container {
  max-width: 500px;
  margin: 0 auto;
  background: var(--bg-page);
  min-height: 100vh;
  padding-bottom: 24px;
}

/* Header */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: var(--white);
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.back-btn, .new-report-btn {
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  font-size: 1.2rem;
  color: var(--text-dark);
  cursor: pointer;
  border-radius: 50%;
  transition: var(--transition);
}

.back-btn:hover, .new-report-btn:hover {
  background: var(--bg-page);
}

.new-report-btn {
  background: var(--primary);
  color: var(--white);
}

.new-report-btn:hover {
  background: var(--primary-light);
}

/* Stats Section */
.stats-section {
  padding: 16px 20px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius-sm);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
}

.stat-icon {
  width: 32px;
  height: 32px;
  background: rgba(91, 33, 182, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  font-size: 0.8rem;
}

.stat-info {
  display: flex;
  flex-direction: column;
}

.stat-value {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-dark);
}

.stat-label {
  font-size: 0.55rem;
  color: var(--text-muted);
}

/* Search Bar */
.search-container {
  padding: 0 20px 12px;
}

.search-input-wrapper {
  display: flex;
  align-items: center;
  background: var(--white);
  border-radius: 60px;
  padding: 0 16px;
  border: 1px solid var(--border-light);
  transition: var(--transition);
}

.search-input-wrapper:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.search-input-wrapper i {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.search-input-wrapper input {
  flex: 1;
  padding: 10px 10px;
  border: none;
  outline: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  background: transparent;
}

.clear-search {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

/* Filters */
.filters-section {
  padding: 0 20px 16px;
  overflow-x: auto;
}

.filters-scroll {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.filters-scroll::-webkit-scrollbar {
  height: 3px;
}

.filters-scroll::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 10px;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border-light);
  border-radius: 40px;
  background: var(--white);
  font-family: 'Poppins', sans-serif;
  font-size: 0.65rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: var(--transition);
}

.filter-btn:hover {
  border-color: var(--primary);
}

.filter-btn.active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

/* Reports List */
.reports-section {
  padding: 0 20px 20px;
}

.reports-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Report Card */
.report-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: var(--transition);
  cursor: pointer;
}

.report-card:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.report-id {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
}

.report-status {
  font-size: 0.6rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.report-status.submitted {
  background: rgba(59, 130, 246, 0.1);
  color: var(--status-submitted);
}

.report-status.under_review {
  background: rgba(245, 158, 11, 0.1);
  color: var(--status-under_review);
}

.report-status.resolved {
  background: rgba(16, 185, 129, 0.1);
  color: var(--status-resolved);
}

.report-status.closed {
  background: rgba(107, 114, 128, 0.1);
  color: var(--status-closed);
}

.report-status.rejected {
  background: rgba(220, 38, 38, 0.1);
  color: var(--status-rejected);
}

.report-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.report-type i {
  margin-right: 4px;
}

.report-description {
  font-size: 0.8rem;
  color: var(--text-dark);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.report-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.report-date {
  font-size: 0.65rem;
  color: var(--text-muted);
}

.view-report-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 600;
  font-size: 0.7rem;
  cursor: pointer;
}

.view-report-btn:hover {
  color: var(--primary-light);
}

/* Load More */
.load-more-btn {
  width: 100%;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: 60px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 16px;
}

.load-more-btn:hover {
  border-color: var(--primary);
  background: rgba(91, 33, 182, 0.05);
}

.loading-indicator {
  text-align: center;
  padding: 20px;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
}

.empty-state i {
  font-size: 4rem;
  color: var(--border-light);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 1.2rem;
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.create-report-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  border-radius: 60px;
  padding: 12px 32px;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.create-report-btn:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 50;
  display: none;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--white);
  border-radius: var(--radius-lg);
  max-width: 380px;
  width: 90%;
  max-height: 85vh;
  overflow-y: auto;
  animation: slideUp 0.3s ease;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 2;
}

.modal-header h3 {
  font-size: 1rem;
}

.close-modal {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-body {
  padding: 20px;
}

/* Detail Modal */
.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border-light);
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-row .label {
  color: var(--text-muted);
}

.detail-row .value {
  font-weight: 600;
  text-align: right;
}

.detail-description {
  padding: 12px 0;
  font-size: 0.85rem;
  color: var(--text-dark);
  line-height: 1.6;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 12px 0;
}

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 4px 0;
}

.timeline-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border-light);
  margin-top: 4px;
  flex-shrink: 0;
}

.timeline-item.completed .timeline-dot {
  background: var(--success);
}

.timeline-item.active .timeline-dot {
  background: var(--primary);
  animation: pulse-dot 1.2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(91, 33, 182, 0.3); }
  50% { box-shadow: 0 0 0 6px rgba(91, 33, 182, 0); }
}

.timeline-title {
  font-size: 0.8rem;
  font-weight: 500;
  display: block;
}

.timeline-time {
  font-size: 0.6rem;
  color: var(--text-muted);
}

/* Support Messages */
.support-messages {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.support-message {
  padding: 12px;
  border-radius: var(--radius-sm);
  max-width: 85%;
}

.support-message.support {
  background: var(--bg-page);
  align-self: flex-start;
}

.support-message.user {
  background: var(--primary);
  color: var(--white);
  align-self: flex-end;
}

.support-message .msg-text {
  font-size: 0.8rem;
}

.support-message .msg-time {
  font-size: 0.6rem;
  opacity: 0.7;
  margin-top: 4px;
  display: block;
}

/* Form Groups */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.required {
  color: var(--error);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.1);
}

.upload-zone {
  border: 2px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.upload-zone:hover {
  border-color: var(--primary);
}

.upload-zone i {
  font-size: 1.5rem;
  color: var(--text-muted);
}

.upload-zone input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.uploaded-files {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-page);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  border: 1px solid var(--border-light);
}

.file-item i {
  color: var(--primary);
}

.file-item .remove-file {
  color: var(--error);
  cursor: pointer;
  margin-left: 4px;
}

/* Modal Footer */
.modal-footer {
  display: flex;
  gap: 10px;
  padding: 16px 20px;
  border-top: 1px solid var(--border-light);
}

.modal-btn {
  flex: 1;
  padding: 10px;
  border-radius: 40px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border-light);
  background: var(--white);
}

.modal-btn.submit-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
}

.modal-btn.submit-btn:hover {
  background: var(--primary-light);
}

.modal-btn.cancel-btn:hover {
  border-color: var(--error);
  color: var(--error);
}

.modal-btn.reply-btn {
  background: var(--secondary);
  color: var(--white);
  border: none;
}

.modal-btn.reply-btn:hover {
  background: var(--secondary-light);
}

/* Loading Overlay */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  
  .stat-card {
    padding: 10px;
  }
  
  .stat-value {
    font-size: 0.8rem;
  }
}