/**
 * View Reported Issues Page Styles
 * Styles for the public-facing problem reports page
 *
 * Created: 2025-12-20
 * Issue: ISSUE-024 - UI/UX Enhancement
 */

/* ============================================
   FILTERS SECTION - Match FAQ page design
   ============================================ */

/* Override scoreboard-controls for view-reported-issues page */
body.view-reported-issues-page .scoreboard-controls {
  background: #000000;
  border: none;
  padding: 20px;
}

body.view-reported-issues-page .scoreboard-controls-grid {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

body.view-reported-issues-page .scoreboard-sort {
  flex: 0 0 auto;
}

body.view-reported-issues-page .scoreboard-sort select {
  background: #000000;
  color: #ffffff;
  border: none;
  padding: 12px 40px 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-width: 180px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

body.view-reported-issues-page .scoreboard-sort select:hover {
  background-color: #222222;
}

body.view-reported-issues-page .scoreboard-results {
  background: #000000;
  color: #ffffff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* ============================================
   REPORTS GRID
   ============================================ */

.reports-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

/* ============================================
   REPORT CARDS
   ============================================ */

.report-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-left: 5px solid #ffee00;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-left-color 0.3s ease;
  cursor: default;
}

.report-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-left-color: #ffd700;
}

.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #ffee00;
}

.report-id {
  font-weight: bold;
  color: #333;
  font-size: 16px;
  font-family: 'Courier New', monospace;
}

/* ============================================
   STATUS BADGES
   ============================================ */

.report-status {
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-open {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-in-progress {
  background: #cfe2ff;
  color: #084298;
  border: 1px solid #9ec5fe;
}

.status-resolved {
  background: #d1e7dd;
  color: #0f5132;
  border: 1px solid #a3cfbb;
}

.status-closed {
  background: #e2e3e5;
  color: #41464b;
  border: 1px solid #c6c7c9;
}

/* ============================================
   REPORT BODY
   ============================================ */

.report-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.report-category,
.report-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #666;
}

.report-category i,
.report-date i {
  color: #28a745;
  font-size: 16px;
}

/* ============================================
   LOADING & ERROR STATES
   ============================================ */

#loading-spinner {
  text-align: center;
  padding: 60px 20px;
  color: #666;
  font-size: 16px;
}

#loading-spinner i {
  font-size: 32px;
  color: #28a745;
  margin-bottom: 15px;
  display: block;
}

#error-message {
  padding: 20px;
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert {
  padding: 15px;
  border-radius: 5px;
  margin-bottom: 20px;
}

.alert-danger {
  background-color: #f8d7da;
  border-color: #f5c6cb;
  color: #721c24;
}

/* ============================================
   EMPTY STATE
   ============================================ */

.no-reports {
  text-align: center;
  padding: 60px 20px;
  color: #666;
}

.no-reports i {
  font-size: 48px;
  color: #28a745;
  margin-bottom: 20px;
  display: block;
}

.no-reports p {
  font-size: 18px;
  color: #666;
  margin: 0;
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
  .reports-grid {
    grid-template-columns: 1fr;
  }

  .filters-container {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-select {
    width: 100%;
  }

  .report-card {
    padding: 15px;
  }

  .report-id {
    font-size: 14px;
  }

  .report-status {
    font-size: 10px;
    padding: 4px 10px;
  }
}

@media (max-width: 480px) {
  .report-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .filters-container {
    padding: 15px;
  }
}

/* ============================================
   CSP COMPLIANCE - Extracted Inline Styles
   Phase 3 Fix (2025-12-21)
   ============================================ */

/* Report Problem Link Styling */
.report-problem-link {
  color: #28a745;
  font-weight: bold;
}

/* Hidden state for loading/error elements */
.hidden-by-default {
  display: none;
}

/* Report problem link styling in header */
.scoreboard-hero-subtitle .report-problem-link {
  color: #ffee00;
  text-decoration: underline;
}

/* Main wrapper stays default (no green override) */

/* Scoreboard-hero styling - green container */
#main .scoreboard-hero {
  background: #28a745 !important;
  border: 1px solid rgba(255, 238, 0, 0.3);
  border-radius: 18px;
  padding: 2rem;
  margin-bottom: 1.5rem;
}

/* Yellow title, black subtitle for scoreboard hero */
#main .scoreboard-hero .scoreboard-hero-title {
  color: #ffee00 !important;
  margin-bottom: 1rem;
}

#main .scoreboard-hero .scoreboard-hero-subtitle {
  color: #000000 !important;
  margin-top: 0.5rem;
}

#main .scoreboard-hero .scoreboard-hero-subtitle .report-problem-link {
  color: #000000 !important;
  text-decoration: underline;
  font-weight: bold;
}

/* Filter controls container - green rounded box */
body.view-reported-issues-page .scoreboard-controls {
  background: #28a745;
  border: none;
  border-radius: 18px;
  padding: 25px 30px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
}

/* Center the content section */
#main #content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   REPORTED DESCRIPTION SECTION
   ============================================ */

.reported-description {
  margin-top: 15px;
  padding: 12px 15px;
  background: #f8f9fa;
  border-left: 3px solid #007bff;
  border-radius: 4px;
}

.reported-description strong {
  display: block;
  color: #007bff !important;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.reported-description strong i {
  margin-right: 5px;
  color: #007bff !important;
}

.reported-description p {
  margin: 0;
  color: #333 !important;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word; /* ENHANCEMENT: Added missing property */
  word-break: break-word; /* ENHANCEMENT: Added missing property */
}

/* ============================================
   ADMIN RESPONSE SECTION
   Task 7b: Display admin fix descriptions
   ============================================ */

.report-card.has-response {
  border-left: 5px solid #28a745;
}

.report-card.has-response:hover {
  border-left-color: #20c997;
}

.admin-response-section {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px dashed #d0d0d0;
  background: linear-gradient(135deg, #f0fff4 0%, #fff 100%);
  margin-left: -20px;
  margin-right: -20px;
  margin-bottom: -20px;
  padding: 15px 20px 20px;
  border-radius: 0 0 8px 4px;
}

.admin-response-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-weight: 600;
  color: #28a745;
  font-size: 14px;
}

.admin-response-header i {
  color: #28a745;
}

.admin-response-text {
  font-size: 14px;
  color: #333;
  line-height: 1.6;
  margin: 0 0 10px 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word; /* ENHANCEMENT: Added missing property */
  word-break: break-word; /* ENHANCEMENT: Added missing property */
}

.admin-response-date {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #888;
  font-style: italic;
}

.admin-response-date i {
  color: #28a745;
  font-size: 12px;
}

/* Mobile responsive adjustments for admin response */
@media (max-width: 768px) {
  .admin-response-section {
    margin-left: -15px;
    margin-right: -15px;
    margin-bottom: -15px;
    padding: 12px 15px 15px;
  }
}

/* ============================================
   FOOTER WHITESPACE REDUCTION (Issue #5)
   Page-specific overrides - view-reported-issues only
   CORRECTED: Added !important to override .wrapper class
   ============================================ */

/* Target main section with .wrapper class */
body.view-reported-issues-page #main.wrapper.style1 {
  padding-bottom: 3em !important; /* Override .wrapper default 9em */
}

/* Target footer with .wrapper class - must override both .wrapper and #footer */
body.view-reported-issues-page #footer.wrapper {
  padding: 0 0 2em 0 !important; /* Override .wrapper (9em) + #footer (6em) */
}

/* Target copyright section */
body.view-reported-issues-page #copyright {
  margin-top: 2em !important; /* Override default 6em */
  padding-top: 2em !important; /* Override default 6em */
}

/* CRITICAL: Override #footer base padding/margin (separate from .wrapper class) */
body.view-reported-issues-page #footer {
  padding-bottom: 0 !important; /* Override main.css line 1934 (6em) */
  margin-bottom: 0 !important;  /* Override main.css line 1935 (6em) */
}

/* Responsive - Tablet */
@media (max-width: 768px) {
  body.view-reported-issues-page #main.wrapper.style1 {
    padding-bottom: 2em !important;
  }
  body.view-reported-issues-page #footer.wrapper {
    padding: 0 0 1.5em 0 !important;
  }
  body.view-reported-issues-page #footer {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  body.view-reported-issues-page #copyright {
    margin-top: 1.5em !important;
    padding-top: 1.5em !important;
  }
}

/* Responsive - Mobile */
@media (max-width: 480px) {
  body.view-reported-issues-page #main.wrapper.style1 {
    padding-bottom: 1.5em !important;
  }
  body.view-reported-issues-page #footer.wrapper {
    padding: 0 0 1em 0 !important;
  }
  body.view-reported-issues-page #footer {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }
  body.view-reported-issues-page #copyright {
    margin-top: 1em !important;
    padding-top: 1em !important;
  }
}

/* ===== TEXT OVERFLOW FIX - Domain Zero Standard ===== */
/* Protect report cards and descriptions from overflow */
.report-card,
.report-id,
.report-category,
.report-date {
  overflow: hidden;
  text-overflow: ellipsis;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
}
