/* Ordinance Search Module - Glassmorphism Design */
:root {
  --primary-bg: #0b1022;
  --secondary-bg: #0e1738;
  --text: #ffffff;
  --text-secondary: #e2e8f0;
  --muted: #94a3b8;
  --accent: #67a8ff;
  --accent-glow: rgba(103, 168, 255, 0.4);
  --border: #223164;
  
  /* Glassmorphism Variables */
  --glass-bg: rgba(255, 255, 255, 0.08);
  --glass-bg-hover: rgba(255, 255, 255, 0.12);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  --glass-shadow-hover: 0 12px 40px rgba(31, 38, 135, 0.5);
  --backdrop-blur: blur(16px);
  
  /* Enhanced Contrast Colors */
  --highlight-red: #ff6b6b;
  --highlight-red-bg: rgba(255, 107, 107, 0.2);
  --highlight-red-border: rgba(255, 107, 107, 0.4);
  --success-green: #51cf66;
  --success-bg: rgba(81, 207, 102, 0.15);
  --warning-orange: #ffd43b;
  --warning-bg: rgba(255, 212, 59, 0.15);
}

* {
  box-sizing: border-box;
}

/* Global text selection highlighting - YELLOW */
::selection {
  background: #ffff00;
  color: #000000;
}

::-moz-selection {
  background: #ffff00;
  color: #000000;
}

html, body {
  margin: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 25%, #667eea 50%, #f093fb 75%, #667eea 100%);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, Segoe UI, Roboto;
  min-height: 100vh;
  position: relative;
}

/* Animated gradient background */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Glass overlay for better readability */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(11, 16, 34, 0.3);
  backdrop-filter: var(--backdrop-blur);
  z-index: -1;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}

header {
  position: sticky;
  top: 0;
  background: rgba(11, 16, 34, .95);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(120%) blur(10px);
  padding: 16px 0;
  z-index: 10;
}

.btn {
  background: linear-gradient(135deg, #1b2b5d, #2a3a6f);
  border: 1px solid #2a3a6f;
  color: var(--text);
  padding: 10px 14px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  filter: brightness(1.1);
}

/* Glassmorphism Panel Base */
.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: var(--backdrop-blur);
  box-shadow: var(--glass-shadow);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.panel:hover {
  background: var(--glass-bg-hover);
  box-shadow: var(--glass-shadow-hover);
  transform: translateY(-2px);
}

/* Compact sticky search panel with enhanced glass effect */
.panel.compact-search {
  position: sticky;
  top: 10px;
  z-index: 100;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 16px;
  padding: 12px 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(20px);
  box-shadow: 
    0 8px 32px rgba(31, 38, 135, 0.37),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: all 0.3s ease;
}

.panel.compact-search:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
  box-shadow: 
    0 12px 40px rgba(31, 38, 135, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.search-input, .form-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  background: #0c1330;
  color: var(--text);
  border: 2px solid var(--border);
  font-size: 16px;
}

.search-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(103, 168, 255, 0.2);
}

/* Search highlighting - BRIGHT Marker Yellow for Exact Matches */
.search-highlight,
.search-highlight-yellow,
mark.search-highlight-yellow,
span.search-highlight {
  background-color: #ffff00 !important;
  color: #000000 !important;
  font-weight: 900 !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  box-shadow: 0 3px 10px rgba(255, 255, 0, 1) !important;
  border: 2px solid rgba(255, 215, 0, 1) !important;
  text-shadow: 0 1px 2px rgba(255, 255, 0, 0.8) !important;
  display: inline !important;
  position: relative !important;
  z-index: 1000 !important;
  animation: highlightPulse 2s ease-in-out infinite !important;
}

/* Results container */
.results-container {
  margin-top: 20px;
}

/* Modern animations - motion-safe by default */
@media (prefers-reduced-motion: no-preference) {
  .ordinance-result {
    animation: fadeInUp 0.6s ease-out both;
  }
  
  @keyframes fadeInUp {
    0% {
      opacity: 0;
      transform: translateY(30px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  .search-input:focus {
    animation: pulse 0.3s ease-out;
  }
  
  @keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
  }
}

/* Glassmorphism Ordinance Result Cards */
.ordinance-result {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 24px;
  padding: 0;
  margin-bottom: 30px;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(16px);
  overflow: hidden;
  box-shadow: 
    0 8px 32px rgba(31, 38, 135, 0.37),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  position: relative;
}

.ordinance-result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.ordinance-result:hover {
  transform: translateY(-8px) rotateX(2deg);
  box-shadow: 
    0 20px 60px rgba(31, 38, 135, 0.5),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(103, 168, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

.ordinance-result > * {
  position: relative;
  z-index: 2;
}

/* Compact PDF Button */
.compact-pdf-btn {
  background: linear-gradient(135deg, #4a2c2a, #3d1a14);
  border: 2px solid #2d0e08;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(74, 44, 42, 0.5);
  float: right;
  margin-bottom: 12px;
  min-width: 120px;
  justify-content: center;
}

.compact-pdf-btn:hover {
  background: linear-gradient(135deg, #5d3532, #4a2219);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(74, 44, 42, 0.7);
  border-color: #3d1a14;
}

/* Search in Document Button */
.search-in-doc-btn {
  background: linear-gradient(135deg, #1e40af, #3b82f6);
  border: 2px solid #1d4ed8;
  color: white;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.5);
  float: right;
  margin-bottom: 12px;
  min-width: 160px;
  justify-content: center;
}

.search-in-doc-btn:hover {
  background: linear-gradient(135deg, #1d4ed8, #2563eb);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 20px rgba(30, 64, 175, 0.7);
  border-color: #1e40af;
}

/* Header buttons container */
.header-buttons {
  display: flex;
  gap: 8px;
  float: right;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

/* Adjust button sizes for side-by-side display */
.header-buttons .compact-pdf-btn,
.header-buttons .search-in-doc-btn {
  float: none;
  margin-bottom: 0;
  min-width: 120px;
  font-size: 13px;
  padding: 8px 14px;
}

/* Disabled PDF button styling */
.compact-pdf-btn.disabled {
  background: linear-gradient(135deg, #6b7280, #9ca3af);
  border-color: #6b7280;
  cursor: not-allowed;
  opacity: 0.6;
}

.compact-pdf-btn.disabled:hover {
  transform: none;
  box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
  background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.ordinance-header {
  margin-bottom: 15px;
  padding: 20px 20px 0 20px;
}

.ordinance-title {
  margin: 0 0 12px 0;
  font-size: 20px;
  font-weight: 600;
  color: #000000;
  text-shadow: none;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.95);
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  display: block;
  width: 100%;
  max-width: none;
}

/* SUPER BRIGHT highlighting in titles - Exact Matches */
.ordinance-title .search-highlight,
.ordinance-title .search-highlight-yellow,
.ordinance-title mark.search-highlight-yellow,
.ordinance-title mark,
.ordinance-title span.search-highlight {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 900 !important;
  padding: 5px 10px !important;
  border-radius: 6px !important;
  box-shadow: 
    0 4px 15px rgba(255, 255, 0, 1) !important,
    inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
  border: 2px solid #ffd700 !important;
  z-index: 1000 !important;
  position: relative !important;
  display: inline !important;
  text-shadow: 0 1px 3px rgba(255, 215, 0, 0.8) !important;
  animation: highlightPulse 1.5s ease-in-out infinite !important;
}

.ordinance-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: #000000;
  font-size: 14px;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 12px;
  border-radius: 6px;
  margin-bottom: 8px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ordinance-meta .meta-primary {
  font-size: 16px;
  font-weight: 700;
  color: #000000;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.2);
}

.ordinance-meta .meta-author {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  padding: 3px 6px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 4px;
}

.ordinance-meta .meta-sponsor {
  font-size: 14px;
  font-weight: 600;
  color: #000000;
  padding: 3px 6px;
  background: rgba(255, 215, 0, 0.3);
  border-radius: 4px;
  border: 1px solid rgba(255, 215, 0, 0.5);
}

.ordinance-excerpt {
  color: #000000;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  padding: 16px 20px;
  margin: 10px 20px;
  line-height: 1.6;
  font-weight: 500;
  text-shadow: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* SUPER BRIGHT highlighting in excerpts - Exact Matches */
.ordinance-excerpt .search-highlight,
.ordinance-excerpt .search-highlight-yellow,
.ordinance-excerpt mark.search-highlight-yellow,
.ordinance-excerpt mark,
.ordinance-excerpt span.search-highlight {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 900 !important;
  padding: 4px 8px !important;
  border-radius: 5px !important;
  box-shadow: 
    0 3px 12px rgba(255, 255, 0, 1) !important,
    inset 0 1px 0 rgba(255, 255, 255, 0.4) !important;
  border: 2px solid #ffd700 !important;
  z-index: 1000 !important;
  position: relative !important;
  display: inline !important;
  text-shadow: 0 1px 2px rgba(255, 215, 0, 0.7) !important;
  animation: highlightPulse 2s ease-in-out infinite !important;
}

.no-results {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
}

.no-results h3 {
  color: var(--text);
  margin-bottom: 10px;
}

/* Loading state */
.loading {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

/* Search stats */
.search-stats {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 20px;
  padding: 10px;
  background: rgba(11, 16, 34, 0.5);
  border-radius: 8px;
}

/* Action buttons */
.ordinance-actions {
  margin-top: 15px;
  padding: 15px 20px 20px 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.action-btn {
  background: linear-gradient(135deg, #1b2b5d, #2a3a6f);
  border: 1px solid #2a3a6f;
  color: var(--text);
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
}

.action-btn:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}

.action-btn.primary {
  background: linear-gradient(135deg, #4a2c2a, #3d1a14);
  border: 2px solid #2d0e08;
  color: white;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 700;
  box-shadow: 0 6px 16px rgba(74, 44, 42, 0.6);
  min-width: 140px;
}

.action-btn.primary:hover {
  background: linear-gradient(135deg, #5d3532, #4a2219);
  border-color: #3d1a14;
  box-shadow: 0 10px 24px rgba(74, 44, 42, 0.8);
  transform: translateY(-2px) scale(1.05);
}

.action-btn.secondary {
  background: linear-gradient(135deg, #2d3748, #4a5568);
  border-color: #4a5568;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Modal styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  z-index: 10000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 20px;
  padding-top: 60px;
  overflow-y: auto;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--secondary-bg);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  width: 100%;
  max-width: 1200px;
  position: relative;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--secondary-bg);
  z-index: 1;
}

.modal-header h2 {
  margin: 0;
  color: var(--accent);
}

.close-btn {
  background: #ff4757;
  border: none;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.close-btn:hover {
  background: #ff3838;
}

.modal-body {
  padding: 20px;
}

/* PDF viewer */
.pdf-container {
  width: 100%;
  height: 70vh;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.full-content {
  line-height: 1.8;
  font-size: 16px;
  color: #000000;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px;
  border-radius: 8px;
  white-space: pre-wrap;
  word-wrap: break-word;
  margin-top: 10px;
  max-height: calc(70vh - 80px);
  overflow-y: auto;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Document search - STICKY */
.document-search {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--secondary-bg);
  padding: 15px;
  margin: -20px -20px 20px -20px; /* Extend to modal edges */
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 10px;
  align-items: center;
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.document-search input {
  flex: 1;
  padding: 12px;
  border-radius: 8px;
  background: #0c1330;
  color: var(--text);
  border: 2px solid var(--border);
  font-size: 14px;
}

.document-search input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(103, 168, 255, 0.2);
}

.search-match-counter {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
  min-width: 120px;
  text-align: right;
}

/* Document search specific action buttons */
.document-search .action-btn {
  padding: 8px 12px;
  font-size: 14px;
  white-space: nowrap;
}

/* Search highlighting in full content */
.document-highlight {
  background-color: #ffeb3b !important;
  color: #000 !important;
  font-weight: bold;
  padding: 2px 4px;
  border-radius: 3px;
}

.document-highlight.current {
  background-color: #ff9800 !important;
  color: white !important;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 10px;
  }
  
  .ordinance-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  /* Adjust font sizes for mobile */
  .ordinance-title {
    font-size: 18px; /* Appropriate mobile size */
  }
  
  .ordinance-meta .meta-primary {
    font-size: 14px; /* Consistent mobile size */
  }
  
  .ordinance-meta .meta-author {
    font-size: 13px; /* Appropriate mobile size */
  }
  
  .ordinance-meta .meta-sponsor {
    font-size: 13px; /* Consistent mobile sizing */
  }
  
  .search-input {
    font-size: 16px; /* Prevent zoom on iOS */
  }
  
  .ordinance-actions {
    flex-direction: column;
  }
  
  .modal-content {
    margin: 10px;
    max-width: calc(100vw - 20px);
  }
  
  .document-search {
    flex-direction: column;
    gap: 8px;
    padding: 12px;
  }
  
  .document-search .action-btn {
    padding: 10px 12px;
  }
  
  .search-match-counter {
    text-align: center;
    min-width: auto;
  }
  
  .pdf-container {
    height: 50vh;
  }
}

/* Compact 5 Pillars Display */
.compact-pillars {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 20px;
  flex-wrap: wrap;
}

.pillar-label {
  color: var(--accent);
  font-weight: 600;
  font-size: 14px;
}

/* Glassmorphism Pillar Buttons */
.pillar-btn {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  position: relative;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  box-shadow: 
    0 2px 8px rgba(31, 38, 135, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.pillar-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1), 
    transparent, 
    rgba(255, 255, 255, 0.05));
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pillar-btn:hover::before {
  opacity: 1;
}

.pillar-btn:hover {
  background: rgba(103, 168, 255, 0.2);
  color: white;
  transform: translateY(-2px) scale(1.05);
  box-shadow: 
    0 6px 20px rgba(103, 168, 255, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-color: rgba(103, 168, 255, 0.4);
}

.pillar-btn.p1 { border-left: 3px solid #10b981; }
.pillar-btn.p2 { border-left: 3px solid #3b82f6; }
.pillar-btn.p3 { border-left: 3px solid #f59e0b; }
.pillar-btn.p4 { border-left: 3px solid #8b5cf6; }
.pillar-btn.p5 { border-left: 3px solid #ef4444; }

/* Mobile compact pillars */
@media (max-width: 768px) {
  .compact-pillars {
    margin: 8px 10px;
    gap: 4px;
  }
  
  .pillar-btn {
    font-size: 11px;
    padding: 3px 6px;
  }
  
  .pillar-label {
    font-size: 13px;
  }
}

/* Advanced Filters Styling */
.filters-container {
  background: rgba(14, 23, 56, 0.6);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  margin-top: 20px;
  backdrop-filter: blur(5px);
}

.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  color: var(--text);
  font-weight: 600;
  font-size: 14px;
}

.filter-select, .filter-input {
  padding: 10px 12px;
  border-radius: 8px;
  background: #0c1330;
  color: var(--text);
  border: 2px solid var(--border);
  font-size: 14px;
  transition: border-color 0.2s ease;
}

.filter-select:focus, .filter-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 3px rgba(103, 168, 255, 0.2);
}

.filter-select option {
  background: #0c1330;
  color: var(--text);
  padding: 8px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  color: white;
}

.filter-btn:not(.secondary) {
  background: linear-gradient(135deg, var(--accent), #5a9aef);
  box-shadow: 0 4px 12px rgba(103, 168, 255, 0.3);
}

.filter-btn.secondary {
  background: linear-gradient(135deg, #374151, #4B5563);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.filter-btn:hover {
  transform: translateY(-2px);
  filter: brightness(1.1);
}

/* Active filter indicator */
.active-filters {
  background: rgba(103, 168, 255, 0.1);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 15px;
  display: none;
}

.active-filters.show {
  display: block;
}

.active-filters h4 {
  margin: 0 0 8px 0;
  color: var(--accent);
  font-size: 14px;
}

.filter-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-tag {
  background: var(--accent);
  color: white;
  padding: 4px 8px;
  border-radius: 12px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.filter-tag .remove {
  cursor: pointer;
  font-weight: bold;
}

/* Mobile filters */
@media (max-width: 768px) {
  .filters-container {
    padding: 15px;
  }
  
  .filters-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .filter-actions {
    flex-direction: column;
  }
  
  .filter-btn {
    width: 100%;
    padding: 14px 16px;
  }
}

/* COMPACT SEARCH STYLES */
.compact-search-container {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search-main {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 2;
  min-width: 300px;
}

.filters-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  min-width: 250px;
}

/* Glassmorphism Input Styles */
.compact-search-input {
  flex: 1;
  padding: 12px 18px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 18px;
  font-weight: 600;
  min-width: 220px;
  backdrop-filter: blur(10px);
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.compact-search-input:focus {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.98);
  color: #000000;
  outline: none;
  box-shadow: 
    0 0 0 3px var(--accent-glow),
    inset 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.compact-search-input::placeholder {
  color: rgba(0, 0, 0, 0.6);
  font-size: 18px;
  font-weight: 500;
}

.compact-input {
  padding: 8px 10px;
  border-radius: 6px;
  background: #0c1330;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 14px;
  width: 90px;
}

.compact-input:focus {
  border-color: var(--accent);
  outline: none;
  box-shadow: 0 0 0 2px rgba(103, 168, 255, 0.1);
}

.compact-select {
  padding: 8px 10px;
  border-radius: 6px;
  background: #0c1330;
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 14px;
  width: 90px;
}

.compact-select:focus {
  border-color: var(--accent);
  outline: none;
}

.compact-select option {
  background: #0c1330;
  color: var(--text);
}

/* Glassmorphism Button Styles */
.compact-btn {
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.compact-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.compact-btn:hover::before {
  left: 100%;
}

.compact-btn:not(.secondary):not(.clear) {
  background: rgba(103, 168, 255, 0.2);
  color: white;
  border-color: rgba(103, 168, 255, 0.4);
  box-shadow: 0 4px 12px rgba(103, 168, 255, 0.3);
}

.compact-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-secondary);
  border-color: rgba(255, 255, 255, 0.2);
}

.compact-btn.filter {
  background: rgba(81, 207, 102, 0.2);
  color: #000000;
  border-color: rgba(81, 207, 102, 0.4);
  box-shadow: 0 4px 12px rgba(81, 207, 102, 0.3);
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 800;
}

.compact-btn.clear {
  background: rgba(255, 107, 107, 0.2);
  color: #000000;
  border-color: rgba(255, 107, 107, 0.4);
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
  padding: 12px 16px;
  font-size: 18px;
  font-weight: 800;
}

.compact-btn:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(31, 38, 135, 0.4);
  border-color: rgba(255, 255, 255, 0.4);
}

.compact-btn:active {
  transform: translateY(-1px) scale(0.98);
}

/* Compact active filters */
.active-filters {
  background: rgba(103, 168, 255, 0.1);
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 6px 12px;
  margin-bottom: 8px;
  display: none;
}

.active-filters.show {
  display: block;
}

.active-filters h4 {
  margin: 0 0 4px 0;
  color: var(--accent);
  font-size: 12px;
}

.filter-tag {
  background: var(--accent);
  color: white;
  padding: 2px 6px;
  border-radius: 8px;
  font-size: 10px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-right: 4px;
}

/* Increase icon sizes throughout the interface */
.compact-search-input::placeholder,
.compact-select option,
.ordinance-meta span,
.compact-pdf-btn,
.action-btn,
h1,
nav a {
  font-size: 16px !important;
}

/* Specific emoji/icon size increases */
.compact-search-input[placeholder*="🔍"]::placeholder {
  font-size: 18px !important;
}

.ordinance-meta span[class*="meta-"] {
  font-size: 16px !important;
}

.compact-pdf-btn {
  font-size: 16px !important;
}

/* Header icons */
header h1,
header nav a {
  font-size: 18px !important;
}

/* Search Suggestions Dropdown */
.search-suggestions-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  margin-top: 4px;
}

.suggestion-item {
  padding: 12px 16px;
  cursor: pointer;
  color: #000000;
  font-size: 16px;
  font-weight: 500;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.suggestion-selected {
  background: rgba(103, 168, 255, 0.2);
  color: #000000;
  transform: translateX(4px);
  border-left: 3px solid #67a8ff;
}

.suggestion-item.suggestion-selected {
  background: rgba(103, 168, 255, 0.3);
  font-weight: 600;
}

.suggestion-item.no-results {
  color: #666666;
  font-style: italic;
  cursor: default;
}

.suggestion-item.no-results:hover {
  background: none;
  transform: none;
}

.suggestions-header {
  padding: 8px 16px;
  background: rgba(103, 168, 255, 0.1);
  color: #000000;
  font-size: 14px;
  font-weight: 700;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  text-align: center;
}

.suggestion-highlight {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 800;
  padding: 1px 3px;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(255, 255, 0, 0.5);
}

/* Hide suggestions on mobile when input loses focus */
@media (max-width: 768px) {
  .search-suggestions-dropdown {
    max-height: 150px;
  }
  
  .suggestion-item {
    padding: 10px 14px;
    font-size: 14px;
  }
}

/* Full Page Ordinance Display */
.ordinance-full-page {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 20px;
  margin-bottom: 40px;
  padding: 0;
  backdrop-filter: blur(16px);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  min-height: 80vh;
  position: relative;
}

.ordinance-full-page::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, 
    rgba(255, 255, 255, 0.1) 0%,
    transparent 50%,
    rgba(255, 255, 255, 0.05) 100%);
  pointer-events: none;
  z-index: 1;
}

.ordinance-full-page > * {
  position: relative;
  z-index: 2;
}

.ordinance-header-full {
  padding: 24px 32px 16px 32px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
}

.header-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.ordinance-number {
  background: rgba(103, 168, 255, 0.2);
  color: #000000;
  padding: 8px 16px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid rgba(103, 168, 255, 0.4);
}

.ordinance-title-full {
  margin: 0 0 16px 0;
  font-size: 28px;
  font-weight: 700;
  color: #000000;
  background: rgba(255, 255, 255, 0.95);
  padding: 16px 20px;
  border-radius: 12px;
  line-height: 1.3;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  white-space: normal;
  word-wrap: break-word;
}

.ordinance-meta-full {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  align-items: center;
}

.ordinance-meta-full > span {
  background: rgba(255, 255, 255, 0.9);
  color: #000000;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.meta-category {
  background: rgba(103, 168, 255, 0.2);
  border-color: rgba(103, 168, 255, 0.4);
}

.meta-author {
  background: rgba(46, 213, 115, 0.2);
  border-color: rgba(46, 213, 115, 0.4);
}

.meta-sponsor {
  background: rgba(255, 215, 0, 0.3);
  border-color: rgba(255, 215, 0, 0.5);
}

.meta-date {
  background: rgba(255, 107, 107, 0.2);
  border-color: rgba(255, 107, 107, 0.4);
}

.ordinance-full-content {
  padding: 24px 32px 32px 32px;
}

.content-header {
  font-size: 20px;
  font-weight: 700;
  color: #67a8ff;
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(103, 168, 255, 0.3);
}

.full-text-content {
  background: rgba(255, 255, 255, 0.95);
  color: #000000;
  padding: 24px;
  border-radius: 12px;
  line-height: 1.8;
  font-size: 16px;
  font-weight: 400;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.1);
  white-space: pre-wrap;
  word-wrap: break-word;
  max-height: none;
  overflow: visible;
}

/* Enhanced highlighting for full content */
.full-text-content .search-highlight,
.full-text-content mark.search-highlight-yellow {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 800 !important;
  padding: 3px 6px !important;
  border-radius: 4px !important;
  border: 1px solid rgba(255, 255, 0, 0.8) !important;
  box-shadow: 0 2px 6px rgba(255, 255, 0, 0.6) !important;
  animation: highlightPulse 2s ease-in-out infinite !important;
  z-index: 10;
  position: relative;
}

.ordinance-page-separator {
  height: 20px;
  background: linear-gradient(90deg, 
    transparent 0%, 
    rgba(103, 168, 255, 0.3) 50%, 
    transparent 100%);
  margin: 0 32px 20px 32px;
}

/* Print styles for full page ordinances */
@media print {
  .ordinance-full-page {
    page-break-after: always;
    background: white;
    border: 1px solid #ccc;
    box-shadow: none;
    min-height: 100vh;
  }
  
  .ordinance-title-full,
  .full-text-content {
    background: white;
    box-shadow: none;
  }
  
  .search-highlight {
    background: #ffff00 !important;
    color: #000000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* Mobile responsive for full page display */
@media (max-width: 768px) {
  .ordinance-full-page {
    margin-bottom: 20px;
    min-height: auto;
  }
  
  .ordinance-header-full {
    padding: 16px 20px 12px 20px;
  }
  
  .header-controls {
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
  }
  
  .ordinance-title-full {
    font-size: 22px;
    padding: 12px 16px;
  }
  
  .ordinance-meta-full {
    flex-direction: column;
    gap: 8px;
  }
  
  .ordinance-full-content {
    padding: 16px 20px 24px 20px;
  }
  
  .content-header {
    font-size: 18px;
  }
  
  .full-text-content {
    padding: 16px;
    font-size: 15px;
    line-height: 1.7;
  }
}

/* Mobile compact layout */
@media (max-width: 768px) {
  .compact-search-container {
    flex-direction: column;
    gap: 8px;
  }
  
  .search-main, .filters-inline {
    width: 100%;
    min-width: auto;
  }
  
  .search-main {
    flex-wrap: wrap;
    gap: 4px;
  }
  
  .filters-inline {
    flex-wrap: wrap;
    justify-content: center;
    gap: 3px;
  }
  
  .compact-search-input {
    min-width: auto;
    width: 100%;
  }
  
  .compact-input, .compact-select {
    width: 70px;
  }
  
  .compact-btn {
    padding: 6px 8px;
    font-size: 11px;
  }
  
  .compact-pdf-btn {
    padding: 5px 10px;
    font-size: 11px;
    float: none;
    margin-bottom: 6px;
  }
}

.search-highlight-yellow {
  background: #ffff00 !important;
  color: #000000 !important;
  border: 1px solid rgba(255, 255, 0, 0.8);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 800;
  text-shadow: none;
  box-shadow: 0 2px 6px rgba(255, 255, 0, 0.5);
  animation: highlightPulse 2s ease-in-out infinite;
  position: relative;
}

.search-highlight-red {
  background: #ffff00;
  color: #000000;
  border: 1px solid rgba(255, 255, 0, 0.8);
  border-radius: 4px;
  padding: 2px 6px;
  font-weight: 800;
  text-shadow: none;
  box-shadow: 0 2px 6px rgba(255, 255, 0, 0.5);
  animation: highlightPulse 2s ease-in-out infinite;
  position: relative;
}

@keyframes highlightPulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 
      0 2px 8px rgba(255, 107, 107, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  50% { 
    transform: scale(1.02);
    box-shadow: 
      0 4px 16px rgba(255, 107, 107, 0.6),
      inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

.search-highlight-red::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -1px;
  right: -1px;
  bottom: -1px;
  background: linear-gradient(45deg, 
    rgba(255, 107, 107, 0.4), 
    rgba(255, 154, 154, 0.4), 
    rgba(255, 107, 107, 0.4));
  border-radius: 7px;
  z-index: -1;
  animation: highlightShimmer 3s ease infinite;
}

@keyframes highlightShimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 0.8; }
}

/* Author Button */
.meta-btn.author-btn{
    background: linear-gradient(135deg,#0b8,#079);
    border:none;
    color:#fff;
    padding:6px 12px;
    border-radius:8px;
    font-size:12px;
    font-weight:600;
    cursor:default;
    margin-left:6px;
}

/* ===== UI Tweaks per Edgar's request ===== */
.ordinance-excerpt{
    display:none !important;
}
.ordinance-title{
    font-size: 26px !important;
    font-weight: 700 !important;
    white-space: normal !important;
    line-height: 1.5 !important;
    overflow: visible !important;
    text-overflow: unset !important;
}
