/* ==========================================================================
   Base Styles and Resets
   ========================================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  width: 100%;
  display: flex;                /* Make body a flex container */
  flex-direction: column;       /* Stack header, main, footer vertically */
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: #333;
  background-color: #f5f7fa;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

input, select, textarea {
  font-family: inherit;
  font-size: 1rem;
  color: #333;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
}

.hidden {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  height: 1px; 
  width: 1px; 
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap; 
}

.text-center {
  text-align: center !important;
}

.flex {
  display: flex;
}

.flex-column {
  flex-direction: column;
}

.flex-wrap {
  flex-wrap: wrap;
}

.align-items-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.gap-sm {
  gap: 0.5rem;
}

.gap-md {
  gap: 1rem;
}

.gap-lg {
  gap: 1.5rem;
}

.mt-sm {
  margin-top: 0.5rem;
}

.mt-md {
  margin-top: 1rem;
}

.mt-lg {
  margin-top: 1.5rem;
}

.mb-sm {
  margin-bottom: 0.5rem;
}

.mb-md {
  margin-bottom: 1rem;
}

.mb-lg {
  margin-bottom: 1.5rem;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
  color: #222;
  font-weight: 600;
  line-height: 1.2;
}

h1 { font-size: 2.5rem; margin-bottom: 0.5rem; }
h2 { font-size: 2rem; margin-bottom: 0.5rem; }
h3 { font-size: 1.75rem; margin-bottom: 0.5rem; }
h4 { font-size: 1.5rem; margin-bottom: 0.5rem; }
h5 { font-size: 1.25rem; margin-bottom: 0.5rem; }
p {
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
  color: #444;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

/* ==========================================================================
   Colors & Variables
   ========================================================================== */
:root {
  --primary-color: #007bff;
  --primary-hover: #0056b3;
  --secondary-color: #6c757d;
  --background-light: #f5f7fa;
  --background-dark: #343a40;
  --text-dark: #222;
  --text-light: #fafafa;
  --success-color: #28a745;
  --warning-color: #ffc107;
  --danger-color: #dc3545;
  --border-radius: 6px;
  --box-shadow-light: 0 2px 8px rgba(0,0,0,0.1);
  --transition-fast: 0.2s ease-in-out;
  --table-header-bg: #f1f1f1;
  --table-row-hover: #f9f9f9;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  background-color: var(--background-dark);
  padding: 1rem 0;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  position: relative;
  z-index: 1000;
}

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

.logo-link {
  display: flex;
  align-items: center;
}

.logo-img {
  width: 40px;
  height: 40px;
  margin-right: 0.5rem;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fafafa;
}

.main-nav .nav-list {
  list-style: none;
  display: flex;
  gap: 2rem;
}

.main-nav .nav-item .nav-link {
  color: #fafafa;
  font-size: 1rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--border-radius);
  transition: background-color var(--transition-fast);
}

.main-nav .nav-item .nav-link:hover,
.main-nav .nav-item .nav-link:focus {
  background-color: rgba(255, 255, 255, 0.1);
}

.main-nav .nav-item .nav-link.active {
  background-color: rgba(255, 255, 255, 0.2);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  outline: none;
}

.nav-toggle .hamburger,
.nav-toggle .hamburger::before,
.nav-toggle .hamburger::after {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background-color: #fafafa;
  border-radius: var(--border-radius);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
  position: relative;
}

.nav-toggle .hamburger::before {
  transform: translateY(-8px);
}

.nav-toggle .hamburger::after {
  transform: translateY(5px);
}

/* ==========================================================================
   Sidebar Legend
   ========================================================================== */
.sidebar-legend {
  position: fixed;
  top: 0;
  right: -320px;
  width: 300px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 8px rgba(0,0,0,0.15);
  transition: right var(--transition-fast);
  z-index: 900;
  display: flex;
  flex-direction: column;
}

.sidebar-legend.open {
  right: 0;
}

.legend-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem;
  background-color: var(--primary-color);
  color: #fff;
  border-top-left-radius: var(--border-radius);
  border-top-right-radius: var(--border-radius);
}

.legend-header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.legend-close {
  font-size: 1.5rem;
  line-height: 1;
  color: #fff;
  background: none;
  border: none;
  padding: 0.25rem 0.5rem;
  transition: color var(--transition-fast);
}

.legend-close:hover {
  color: #ffdddd;
}

.legend-list {
  list-style: none;
  padding: 1rem;
  flex: 1;
}

.legend-list li {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  color: #333;
}

.legend-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-right: 0.75rem;
  border-radius: 50%;
}

.legend-icon-illegal {
  background-color: var(--danger-color);
}

.legend-icon-approved {
  background-color: var(--success-color);
}

.legend-icon-rejected {
  background-color: var(--warning-color);
}

/* ==========================================================================
   Main Section & Layout (Admin)
   ========================================================================== */
.site-main {
  flex: 1;                      /* Allow main to grow and push footer down */
  display: flex;
  flex-direction: column;
  padding: 2rem 0;
}

.admin-header-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.admin-header-section .page-title {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-dark);
}

.logout-btn {
  background-color: var(--secondary-color);
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.logout-btn:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}

/* ==========================================================================
   Filter & Search Controls (Admin)
   ========================================================================== */
.admin-filters {
  background-color: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-light);
  padding: 1rem 1.5rem;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}

.filter-form {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
}

.filter-select,
.filter-input {
  padding: 0.5rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
}

.filter-select:focus,
.filter-input:focus {
  border-color: var(--primary-color);
  outline: none;
}

.filter-btn {
  background-color: var(--primary-color);
  color: #fff;
  padding: 0.6rem 1.2rem;
  border-radius: var(--border-radius);
  font-size: 1rem;
  font-weight: 600;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.filter-btn:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   Reports Table Styles (Admin)
   ========================================================================== */
.admin-table-section {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  background-color: #fff;
  box-shadow: var(--box-shadow-light);
  border-radius: var(--border-radius);
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 0.75rem 1rem;
  text-align: left;
  font-size: 0.95rem;
  vertical-align: middle;
  border-bottom: 1px solid #e0e0e0;
}

.admin-table th {
  background-color: var(--table-header-bg);
  font-weight: 700;
  color: var(--text-dark);
}

.admin-table tbody tr:hover {
  background-color: var(--table-row-hover);
}

.admin-table tbody tr:nth-child(even) {
  background-color: #fafafa;
}

/* Column Widths */
.admin-table td:nth-child(1) { width: 8%; font-weight: 600; }   /* ID */
.admin-table td:nth-child(2) { width: 30%; max-width: 300px; word-wrap: break-word; } /* Description */
.admin-table td:nth-child(3) { width: 12%; } /* Status */
.admin-table td:nth-child(4) { width: 15%; } /* Date Reported */
.admin-table td:nth-child(5) { width: 10%; } /* Photo */
.admin-table td:nth-child(6) { width: 15%; font-family: monospace; } /* Location */
.admin-table td:nth-child(7) { width: 10%; } /* Actions */

.admin-table td img {
  width: 60px;
  height: 40px;
  object-fit: cover;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-light);
}

/* Action Buttons */
.action-btn {
  padding: 0.4rem 0.8rem;
  border-radius: var(--border-radius);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform var(--transition-fast), background-color var(--transition-fast);
  color: #fff;
  border: none;
  margin-right: 0.25rem;
}

.action-btn.verify {
  background-color: var(--success-color);
}

.action-btn.verify:hover {
  background-color: #218838;
  transform: translateY(-1px);
}

.action-btn.reject {
  background-color: var(--danger-color);
}

.action-btn.reject:hover {
  background-color: #c82333;
  transform: translateY(-1px);
}

.action-btn.delete {
  background-color: var(--warning-color);
}

.action-btn.delete:hover {
  background-color: #e0a800;
  transform: translateY(-1px);
}

/* ==========================================================================
   Confirm Action Modal Styles
   ========================================================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 1rem;
}

.modal.open {
  display: flex;
}

.modal-content {
  background-color: #fff;
  width: 100%;
  max-width: 500px;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--box-shadow-light);
  position: relative;
  animation: fadeInUp var(--transition-fast);
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: #666;
  transition: color var(--transition-fast);
}

.modal-close:hover {
  color: #000;
}

.modal-body {
  padding: 1.5rem;
}

#confirm-modal-title {
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  color: var(--text-dark);
}

#confirm-modal-text {
  margin-bottom: 1rem;
  color: #555;
}

.modal-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
}

.modal-actions .btn {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
}

#confirm-action-btn {
  background-color: var(--danger-color);
  color: #fff;
}

#confirm-action-btn:hover {
  background-color: #c82333;
  transform: translateY(-1px);
}

#cancel-action-btn {
  background-color: var(--secondary-color);
  color: #fff;
}

#cancel-action-btn:hover {
  background-color: #5a6268;
  transform: translateY(-1px);
}

/* Keyframes for modal animation */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Toast Notification Styles
   ========================================================================== */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1002;
}

.toast {
  background-color: var(--background-dark);
  color: #fff;
  padding: 1rem 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 250px;
  animation: slideInRight var(--transition-fast);
}

.toast p {
  margin: 0;
  font-size: 0.95rem;
}

.toast-close {
  font-size: 1.25rem;
  color: #fff;
  background: none;
  border: none;
  margin-left: 0.75rem;
  transition: color var(--transition-fast);
}

.toast-close:hover {
  color: var(--warning-color);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* ==========================================================================
   Footer Styles (Sticky to Bottom)
   ========================================================================== */
.site-footer {
  background-color: var(--background-dark);
  color: #ccc;
  padding: 1.5rem 0;
  margin-top: auto;              /* Pushes footer to bottom when main grows */
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.footer-link {
  color: #ccc;
  font-size: 0.95rem;
  transition: color var(--transition-fast);
}

.footer-link:hover {
  color: #fff;
}

.footer-text {
  font-size: 0.9rem;
  margin-top: 0.5rem;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */
@media (max-width: 992px) {
  .admin-header-section {
    flex-direction: column;
    gap: 1rem;
  }

  .admin-filters {
    flex-direction: column;
    gap: 1rem;
  }

  .filter-form {
    flex-direction: column;
    gap: 1rem;
  }

  .admin-table {
    font-size: 0.9rem;
  }
}

@media (max-width: 576px) {
  .admin-table th,
  .admin-table td {
    padding: 0.5rem 0.75rem;
  }

  .action-btn {
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
  }

  .modal-content {
    max-width: 90%;
  }
}

/* ==========================================================================
   Leaflet Overrides (if needed for admin map integration)
   ========================================================================== */
.leaflet-container {
  border-radius: var(--border-radius);
}

.leaflet-popup-content-wrapper {
  border-radius: var(--border-radius);
}

.leaflet-popup-content {
  font-size: 0.9rem;
}

/* ==========================================================================
   Custom Scrollbar (WebKit)
   ========================================================================== */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: var(--border-radius);
}

::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: var(--border-radius);
  transition: background-color var(--transition-fast);
}

::-webkit-scrollbar-thumb:hover {
  background: #999;
}

/* Container for the login section */
.login-section {
  background-color: #ffffff;
  padding: 2rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
  width: 100%;
  max-width: 400px;
  margin: 3rem auto;
}

/* Page title styling */
.login-section .page-title {
  font-size: 1.75rem;
  font-weight: 600;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #333333;
}

/* Each form group (label + input) */
.login-section .form-group {
  margin-bottom: 1rem;
}

/* Label styling */
.login-section .form-group label {
  display: block;
  font-size: 0.9rem;
  font-weight: 500;
  color: #444444;
  margin-bottom: 0.25rem;
}

/* Input fields (email & password) */
.login-section .form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid #cccccc;
  border-radius: 0.375rem;
  outline: none;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.login-section .form-input:focus {
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.2);
}

/* Error message paragraph (hidden by default) */
#login-error {
  font-size: 0.9rem;
  color: #e74c3c;
  margin-top: 0.5rem;
}

/* Submit button */
.login-section .btn-primary {
  display: inline-block;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #ffffff;
  background-color: #007bff;
  border: none;
  border-radius: 0.375rem;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s ease-in-out;
}

.login-section .btn-primary:hover {
  background-color: #0056b3;
}

.login-section .btn-primary:active {
  background-color: #004494;
}

/* Utility: hide elements with .hidden */
.hidden {
  display: none !important;
}
