/* COMPLAINTS.CSS — Complaint Form & List Styles */

.complaints-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

@media (max-width: 1024px) {
  .complaints-layout { grid-template-columns: 1fr; }
}

/* ── Form Card ──────────────────────────────────────────────── */
.complaint-form-card {
  padding: var(--space-xl);
  position: sticky;
  top: var(--space-xl);
}

.form-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.form-field {
  margin-bottom: var(--space-md);
}

.form-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-xs);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 0.9rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

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

.form-field select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ── GPS Section ────────────────────────────────────────────── */
.gps-section {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
  margin-bottom: var(--space-sm);
}

.gps-btn {
  padding: 11px 18px;
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--border-radius-xs);
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.gps-btn:hover:not(:disabled) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.gps-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.gps-status {
  font-size: 0.78rem;
  color: var(--color-text-muted);
}

.gps-status.success { color: var(--color-success); font-weight: 500; }

/* ── Image Upload ───────────────────────────────────────────── */
.image-dropzone {
  border: 2px dashed var(--color-border);
  border-radius: var(--border-radius-sm);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  background: rgba(79, 70, 229, 0.02);
}

.image-dropzone:hover, .image-dropzone.dragover {
  border-color: var(--color-primary);
  background: rgba(79, 70, 229, 0.05);
}

.dropzone-icon { font-size: 2rem; margin-bottom: var(--space-sm); }

.dropzone-text {
  font-size: 0.88rem;
  color: var(--color-text-secondary);
  font-weight: 500;
}

.dropzone-hint {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.image-preview {
  display: none;
  position: relative;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.image-preview img {
  width: 100%;
  max-height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius-sm);
}

.remove-image-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 6px 12px;
  background: rgba(0,0,0,0.7);
  color: white;
  border: none;
  border-radius: var(--border-radius-xs);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition-fast);
}

.remove-image-btn:hover { background: var(--color-danger); }

/* ── Upload Progress ────────────────────────────────────────── */
.upload-progress {
  display: none;
  margin-bottom: var(--space-md);
}

.progress-bar {
  height: 6px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: var(--gradient-primary);
  border-radius: 3px;
  width: 0%;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ── Status Message ─────────────────────────────────────────── */
.complaint-status {
  display: none;
  padding: 12px 16px;
  border-radius: var(--border-radius-xs);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: var(--space-md);
}

.complaint-status.success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

.complaint-status.error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-danger);
}

/* ── Complaints List ────────────────────────────────────────── */
.complaints-list-section h2 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

.complaints-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.complaint-item {
  display: flex;
  gap: var(--space-md);
  padding: var(--space-md);
  cursor: default;
}

.complaint-item:hover {
  transform: none;
}

.complaint-image {
  width: 140px;
  height: 100px;
  flex-shrink: 0;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
}

.complaint-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.complaint-details { flex: 1; min-width: 0; }

.complaint-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin-bottom: var(--space-sm);
}

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

.complaint-details h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.complaint-details p {
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.complaint-location {
  font-size: 0.78rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.complaint-author {
  font-size: 0.72rem;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
  font-weight: 500;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── Voting UI ──────────────────────────────────────────────── */
.complaint-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(15, 23, 42, 0.4);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.vote-btn {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.6;
  transition: all 0.2s ease;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.vote-btn:hover:not(:disabled) {
  opacity: 1;
  background: rgba(255, 255, 255, 0.1);
  transform: scale(1.1);
}

.vote-btn:disabled {
  cursor: not-allowed;
  opacity: 0.3;
}

.vote-btn.voted-up {
  opacity: 1;
  color: var(--color-success);
  text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.vote-btn.voted-down {
  opacity: 1;
  color: var(--color-danger);
  text-shadow: 0 0 10px rgba(239, 68, 68, 0.5);
}

.vote-score {
  font-weight: 700;
  font-size: 0.85rem;
  min-width: 20px;
  text-align: center;
  color: var(--color-text);
}


.loading-spinner {
  text-align: center;
  padding: var(--space-xl);
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

@media (max-width: 580px) {
  .complaint-item { flex-direction: column; }
  .complaint-image { width: 100%; height: 160px; }
}
