/* ============================================================
   Issue Reporter — Main Stylesheet
   No external dependencies. System font stack. Plain CSS.
   ============================================================ */

/* ------------------------------------------------------------
   Base & Layout
   ------------------------------------------------------------ */

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #f5f5f5;
  color: #333;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.5;
}

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
}

header {
  margin-bottom: 2rem;
}

header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.75rem;
}

.project-name {
  margin: 0;
  color: #555;
  font-size: 0.95rem;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ------------------------------------------------------------
   Upload Section
   ------------------------------------------------------------ */

.upload-section {
  margin-bottom: 2rem;
}

.upload-section h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.upload-hint {
  color: #666;
  font-size: 0.85rem;
  margin: 0 0 0.5rem;
}

/* ------------------------------------------------------------
   Drop Zones
   ------------------------------------------------------------ */

.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.drop-zone:focus {
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.drop-zone--dragover {
  border-color: #4a90d9;
  background: rgba(74, 144, 217, 0.05);
}

.drop-zone--evidence {
  padding: 1.25rem 2rem;
}

.drop-zone__prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: #999;
  pointer-events: none;
}

.drop-zone__icon {
  font-size: 2rem;
  color: #999;
  line-height: 1;
}

/* Hidden file input — triggered via JS click */
.drop-zone__input {
  display: none;
}

/* ------------------------------------------------------------
   File Cards Container
   ------------------------------------------------------------ */

.file-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 1rem;
}

/* ------------------------------------------------------------
   File Card
   ------------------------------------------------------------ */

.file-card {
  width: 140px;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
  position: relative;
  flex-shrink: 0;
}

/* Thumbnail (images) */
.file-card__thumbnail {
  width: 100%;
  height: 100px;
  object-fit: cover;
  display: block;
}

/* Video placeholder */
.file-card__video-icon {
  width: 100%;
  height: 100px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: #999;
}

/* File info strip */
.file-card__info {
  padding: 8px;
  font-size: 0.75rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #444;
}

/* Progress bar track (sits at bottom of thumbnail area) */
.file-card__progress {
  height: 3px;
  background: #e0e0e0;
}

/* Progress bar fill */
.file-card__progress-bar {
  height: 100%;
  background: #4a90d9;
  width: 0%;
  transition: width 0.2s ease;
}

/* Delete button (X in corner) */
.file-card__delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 20px;
  text-align: center;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-card__delete:hover {
  background: rgba(220, 50, 50, 0.8);
}

/* Error state */
.file-card--error {
  border-color: #e74c3c;
}

.file-card__error {
  padding: 8px;
  font-size: 0.7rem;
  color: #e74c3c;
  text-align: center;
}

/* Retry button inside error card */
.file-card__retry {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  border: none;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.7rem;
  margin-top: 4px;
}

.file-card__retry:hover {
  background: #c0392b;
}

/* Uploading state */
.file-card--uploading {
  opacity: 0.8;
}

/* ------------------------------------------------------------
   Evidence Card
   ------------------------------------------------------------ */

.evidence-card {
  width: 100%;
  max-width: 400px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: #fff;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  flex-shrink: 0;
}

.evidence-card__badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: bold;
  color: #fff;
  text-transform: uppercase;
  flex-shrink: 0;
}

.evidence-card__badge--har {
  background: #2ecc71;
}

.evidence-card__badge--zip {
  background: #3498db;
}

.evidence-card__name {
  font-size: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #444;
  flex: 1;
  margin-left: 8px;
}

/* Delete button reused on evidence card */
.evidence-card .file-card__delete {
  position: static;
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   Form Section
   ------------------------------------------------------------ */

.form-section {
  margin-top: 2rem;
}

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

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 0.95rem;
}

.required {
  color: #e74c3c;
}

.optional {
  color: #999;
  font-weight: normal;
  font-size: 0.85rem;
}

.form-input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 1rem;
  font-family: inherit;
  box-sizing: border-box;
  background: #fff;
  color: #333;
  transition: border-color 0.15s;
}

.form-input:focus {
  outline: none;
  border-color: #4a90d9;
  box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.2);
}

.form-textarea {
  resize: vertical;
  font-family: inherit;
}

/* ------------------------------------------------------------
   Buttons
   ------------------------------------------------------------ */

.btn {
  padding: 10px 24px;
  border: none;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn--primary {
  background: #4a90d9;
  color: #fff;
}

.btn--primary:hover {
  background: #357abd;
}

.btn--primary:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* ------------------------------------------------------------
   Status Messages
   ------------------------------------------------------------ */

.error-message {
  color: #e74c3c;
  margin-top: 8px;
  font-size: 0.85rem;
}

.success-message {
  color: #2ecc71;
  margin-top: 8px;
  font-size: 0.85rem;
}

/* ------------------------------------------------------------
   Responsive — narrow screens
   ------------------------------------------------------------ */

@media (max-width: 480px) {
  .container {
    padding: 1rem;
  }

  .file-card {
    width: 100px;
  }

  .file-card__thumbnail,
  .file-card__video-icon {
    height: 80px;
  }

  .gallery-item {
    width: 120px;
    height: 90px;
  }
}

/* ------------------------------------------------------------
   Report Cards
   ------------------------------------------------------------ */

.report-card {
  background: #fff;
  border: none;
  border-radius: 10px;
  padding: 1.75rem;
  margin-bottom: 1.75rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06), 0 2px 12px rgba(0, 0, 0, 0.04);
}

.report-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  margin-bottom: 1.25rem;
  border-bottom: 1px solid #eee;
}

.report-card__number {
  font-weight: 800;
  font-size: 1.15rem;
  color: #4a90d9;
}

.report-card__date {
  font-size: 0.82rem;
  color: #aaa;
  font-weight: 400;
}

/* Shared section spacing */
.report-card__url,
.report-card__description,
.report-card__console,
.report-card__section {
  margin-bottom: 1.25rem;
}

.report-card__url:last-child,
.report-card__description:last-child,
.report-card__console:last-child,
.report-card__section:last-child {
  margin-bottom: 0;
}

/* Section labels — uppercase accent bar dividers */
.report-card__label {
  margin: 0 0 0.5rem;
  font-size: 0.7rem;
  color: #888;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding-left: 12px;
  border-left: 3px solid #4a90d9;
  line-height: 1;
  padding-top: 1px;
  padding-bottom: 1px;
}

/* URL section */
.report-card__url a {
  color: #4a90d9;
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.report-card__url a::before {
  content: "\2197\00a0";
  font-size: 0.9em;
  opacity: 0.6;
}

.report-card__url a:hover {
  text-decoration: underline;
}

/* Description */
.report-card__description-text {
  margin: 0;
  white-space: pre-wrap;
  line-height: 1.65;
  color: #444;
  padding-left: 14px;
  border-left: 2px solid #e0e0e0;
}

/* ------------------------------------------------------------
   Media Gallery
   ------------------------------------------------------------ */

.report-card__gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.gallery-item {
  display: block;
  width: 160px;
  height: 120px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  cursor: pointer;
  text-decoration: none;
  position: relative;
  background: #f0f0f0;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.gallery-item:hover {
  border-color: #4a90d9;
  box-shadow: 0 2px 8px rgba(74, 144, 217, 0.18);
  transform: translateY(-1px);
}

.gallery-item--image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-item--video {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #e8e8e8;
  color: #666;
}

.gallery-item__play {
  font-size: 2rem;
  line-height: 1;
}

.gallery-item__name {
  font-size: 0.65rem;
  margin-top: 4px;
  padding: 0 6px;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  color: #666;
}

/* ------------------------------------------------------------
   Evidence Links
   ------------------------------------------------------------ */

.report-card__evidence {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.evidence-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  background: #f8f9fa;
  text-decoration: none;
  color: #444;
  font-size: 0.85rem;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.evidence-link:hover {
  border-color: #4a90d9;
  background: #f0f5fb;
  box-shadow: 0 1px 4px rgba(74, 144, 217, 0.12);
  color: #333;
}

.evidence-link__text {
  font-size: 0.8rem;
  color: #666;
}

/* ------------------------------------------------------------
   Flash Messages
   ------------------------------------------------------------ */

.flash {
  padding: 12px 16px;
  border-radius: 4px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.flash--success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.flash--error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* ------------------------------------------------------------
   Create Project Form
   ------------------------------------------------------------ */

.create-project {
  margin-bottom: 2rem;
}

.create-project__form,
.create-project__form-vertical {
  display: flex;
  gap: 8px;
}

.create-project__form-vertical {
  flex-direction: column;
}

.create-project__form .form-input {
  flex: 1;
}

.create-project__form .btn {
  flex-shrink: 0;
}

/* ------------------------------------------------------------
   Project List and Cards
   ------------------------------------------------------------ */

.project-list {
  margin-top: 1rem;
}

.project-card {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  margin-bottom: 8px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.project-card:hover {
  border-color: #4a90d9;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.project-card__info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.project-card__name {
  font-weight: 600;
  font-size: 1rem;
}

.project-card__meta {
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: #888;
}

.project-card__slug {
  font-family: monospace;
}

.project-card__actions {
  display: flex;
  gap: 6px;
  margin-left: 12px;
  flex-shrink: 0;
}

.btn--small {
  padding: 5px 12px;
  font-size: 0.8rem;
  border-radius: 4px;
  text-decoration: none;
  color: #fff;
  background: #4a90d9;
}

.btn--small:hover {
  background: #357abd;
}

.btn--small.btn--muted {
  background: #f0f0f0;
  color: #555;
  border: 1px solid #ccc;
}

.btn--small.btn--muted:hover {
  background: #e0e0e0;
}

/* ------------------------------------------------------------
   Back Link
   ------------------------------------------------------------ */

.back-link {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: #4a90d9;
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link:hover {
  text-decoration: underline;
}

/* ------------------------------------------------------------
   Empty State
   ------------------------------------------------------------ */

.empty-state {
  color: #999;
  font-style: italic;
}

/* ------------------------------------------------------------
   Lightbox Modal
   ------------------------------------------------------------ */

.lightbox-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  display: none;               /* shown via JS */
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 2rem;
}

.lightbox-content {
  max-width: 90vw;
  max-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.lightbox-video {
  max-width: 90vw;
  max-height: 85vh;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
  background: #000;
}

.lightbox-close {
  position: fixed;
  top: 1rem;
  right: 1.5rem;
  background: none;
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 1001;
  line-height: 1;
  padding: 0;
  opacity: 0.8;
  transition: opacity 0.15s;
}

.lightbox-close:hover {
  opacity: 1;
}

/* ============================================================
   Console Output
   ============================================================ */

.form-textarea--code {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.85rem;
  background-color: #1e1e1e;
  color: #d4d4d4;
  border-color: #333;
}

.report-nav {
  margin: 0.5rem 0 1rem;
}

.report-nav a {
  color: #4a90d9;
  text-decoration: none;
  font-size: 0.9rem;
}

.report-nav a:hover {
  text-decoration: underline;
}

.btn--archive {
  margin-left: auto;
  padding: 0.25rem 0.75rem;
  font-size: 0.8rem;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 4px;
  cursor: pointer;
  color: #555;
}

.btn--archive:hover {
  background: #e0e0e0;
}

.btn--danger {
  background: #e74c3c;
  color: #fff;
  border: none;
}

.btn--danger:hover {
  background: #c0392b;
}

.btn--danger-sm {
  margin-left: 4px;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  background: #e74c3c;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.btn--danger-sm:hover {
  background: #c0392b;
}

.console-output {
  background-color: #1e1e1e;
  color: #d4d4d4;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  font-size: 0.8rem;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 300px;
  overflow-y: auto;
  margin: 0;
}
