/* ==========================================================================
   FindARescue.ie - Main Stylesheet
   Unified styles for all pages (index, map, about)
   ========================================================================== */

/* ==========================================================================
   CSS Reset - Ensures consistent styling across browsers
   ========================================================================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ==========================================================================
   Base Styles - Applied to all pages
   ========================================================================== */
body {
  font-family: 'Poppins', sans-serif;
  background: #f8f9fa;
  color: #1f2937;
}

/* ==========================================================================
   Navigation Header - Top navigation bar used on all pages
   ========================================================================== */
.nav-header {
  background: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0.75rem 1rem;
  margin-bottom: 2rem;
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.logo-section {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-section img {
  height: 32px;
  width: auto;
  max-width: 32px;
  object-fit: contain;
}

.site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  text-decoration: none;
}

/* Navigation Tabs */
.nav-tabs {
  display: flex;
  gap: 0.5rem;
  list-style: none;
}

.nav-tabs a {
  padding: 0.5rem 1.25rem;
  text-decoration: none;
  color: #666;
  background: transparent;
  border-radius: 8px;
  transition: all 0.3s ease;
  font-size: 0.9rem;
  font-weight: 500;
  border: 2px solid transparent;
  white-space: nowrap;
}

.nav-tabs a:hover {
  color: #333;
  background: #f0f0f0;
}

.nav-tabs a.active {
  color: #0077cc;
  border-color: #0077cc;
  background: #e6f4ff;
}

/* ==========================================================================
   Main Content Wrapper - Contains page content below navigation
   Used on: index.html, about.html
   ========================================================================== */
.content-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem 2rem 2rem;
}

/* ==========================================================================
   Header Section - Logo and tagline display
   Used on: index.html
   ========================================================================== */
header.main-header {
  text-align: center;
  padding: 2rem;
  background: #ffffff;
  color: #333;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

header.main-header img {
  width: 450px;
  height: auto;
  margin-bottom: 1rem;
  max-width: 100%;
}

.header-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
}

.header-content p {
  margin: 0.5rem 0;
}

/* ==========================================================================
   Search and Filter Section - Search box and dropdown filters
   Used on: index.html
   ========================================================================== */

/* Search Container */
.search-container {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 500px;
  margin: 1rem auto;
}

/* Search Input Field */
input[type="text"] {
  padding: 1rem;
  width: 100%;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-size: 1rem;
  outline: none;
  transition: all 0.3s ease-in-out;
  background: #ffffff;
  flex: 1;
}

input[type="text"]:focus {
  border-color: #888;
  box-shadow: 0 0 10px rgba(136, 136, 136, 0.5);
}

/* Filter Wrapper */
.filter-wrapper {
  max-width: 500px;
  margin: 0 auto 2rem auto;
}

.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

/* Filter Dropdown Selects */
.filter-bar select {
  padding: 0.8rem 0.9rem;
  font-size: 0.9rem;
  flex: 1;
  border: 2px solid #ccc;
  border-radius: 5px;
  font-family: 'Poppins', sans-serif;
  background-color: #ffffff;
  color: #1f2937;
  outline: none;
  transition: all 0.3s ease-in-out;
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 1rem;
}

.filter-bar select:focus {
  border-color: #888;
  box-shadow: 0 0 8px rgba(136, 136, 136, 0.4);
}

/* Info and Reset Icons */
.info-icon {
  position: relative;
  cursor: pointer;
  font-size: 22px;
  user-select: none;
  color: #555;
  line-height: 1;
  background-color: transparent;
  transition: color 0.2s;
  flex-shrink: 0;
}

.info-icon:hover {
  color: #000;
}

/* Tooltip for Info Icons */
.info-icon::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 120%;
  left: 50%;
  transform: translateX(-50%);
  background-color: #333;
  color: #fff;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: normal;
  max-width: 220px;
  width: max-content;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease-in-out;
  z-index: 1000;
  text-align: left;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  line-height: 1.4;
}

.info-icon:hover::after {
  opacity: 1;
}

/* ==========================================================================
   Results Grid - Grid layout for rescue cards
   Used on: index.html
   ========================================================================== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

/* ==========================================================================
   Resource Cards - Individual rescue organization cards
   Used on: index.html
   ========================================================================== */
.card {
  border: 1px solid #ddd;
  padding: 1rem;
  border-radius: 5px;
  background: white;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease-in-out;
  text-align: center;
}

.card:hover {
  transform: scale(1.04);
}

.card img {
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.card h2 {
  font-size: 1.25rem;
  color: #333;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.875rem;
  color: #666;
}

/* ==========================================================================
   Action Links - Donate and Social Media links on cards
   Used on: index.html
   ========================================================================== */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.85; }
  100% { transform: scale(1); opacity: 1; }
}

.donation-link,
.more-info-link {
  visibility: hidden;
  opacity: 0;
  margin-top: 10px;
  font-weight: bold;
  color: #0077cc;
  text-decoration: underline;
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
}

.donation-link {
  float: left;
}

.more-info-link {
  float: right;
}

.card:hover .donation-link,
.card:hover .more-info-link {
  visibility: visible;
  opacity: 1;
  animation: pulse 1s ease-in-out;
}

.donation-link:hover,
.more-info-link:hover {
  color: #005fa3;
}

/* ==========================================================================
   Tags System - Category and location tags on cards
   Used on: index.html
   ========================================================================== */
.tags-container {
  margin-top: 0.5rem;
}

.tag {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  margin-right: 0.25rem;
  margin-bottom: 0.25rem;
}

.tag.selected {
  outline: 2px solid #000;
}

/* Tag Color Schemes - Different colors for different regions */
.tag-blue {
  background-color: #d0e8ff;
  color: #005fa3;
}

.tag-orange {
  background-color: #ffe7d0;
  color: #a34400;
}

.tag-yellow {
  background-color: #fff9d6;
  color: #cc8800;
}

.tag-purple {
  background-color: #f0e6ff;
  color: #6b2c91;
}

.tag-teal {
  background-color: #d0f7f4;
  color: #006b5d;
}

.tag-coral {
  background-color: #ffe4e1;
  color: #c85250;
}

/* ==========================================================================
   Map Container - Full-screen map display
   Used on: map.html
   ========================================================================== */
.map-container {
  position: fixed;
  top: 70px;
  left: 0;
  right: 0;
  bottom: 0;
  overflow: hidden;
}

.map-container iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

/* Overlay Box on Map */
.overlay-box {
  position: fixed;
  top: 150px;
  right: 10px;
  width: 300px;
  height: 150px;
  border: 0;
  z-index: 999;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  border-radius: 6px;
}

/* ==========================================================================
   About Page Styles - Content sections for about page
   Used on: about.html
   ========================================================================== */
.content-section {
  background: #ffffff;
  padding: 2.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.page-title {
  font-size: 2rem;
  color: #333;
  margin-bottom: 1.5rem;
  text-align: center;
}

.section-title {
  font-size: 1.5rem;
  color: #333;
  margin-bottom: 1rem;
  margin-top: 1.5rem;
}

.section-title:first-of-type {
  margin-top: 0;
}

.content-section p {
  line-height: 1.7;
  margin-bottom: 1rem;
  color: #555;
}

.highlight-box {
  background: #e6f4ff;
  border-left: 4px solid #0077cc;
  padding: 1.5rem;
  margin: 1.5rem 0;
  border-radius: 5px;
}

.highlight-box p {
  margin-bottom: 0;
}

.contact-info {
  text-align: center;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  margin-top: 2rem;
}

.contact-info a {
  color: #0077cc;
  text-decoration: none;
  font-weight: 600;
}

.contact-info a:hover {
  text-decoration: underline;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  text-align: center;
  padding: 1.5rem;
  background: #f8f9fa;
  border-radius: 8px;
  border: 2px solid #e0e0e0;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: 600;
  color: #0077cc;
  display: block;
  margin-bottom: 0.5rem;
}

.stat-label {
  color: #666;
  font-size: 0.95rem;
}

.about-content {
  display: flex;
  align-items: flex-start;
  gap: 3rem; /* space between text and image */
}

.about-text {
  flex: 1;
}

.about-image {
  width: 250px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
}

.about-figure {
  margin: 0;
  text-align: center;
  flex-shrink: 0;
}

.about-caption {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}



/* ==========================================================================
   Footer - Site footer used on all pages
   ========================================================================== */
footer {
  margin-top: 3rem;
  text-align: center;
  color: #666;
  font-size: 0.9rem;
  padding-bottom: 2rem;
}

/* ==========================================================================
   Responsive Design - Tablet and mobile adjustments
   ========================================================================== */

/* Tablet and Small Desktop (768px and below) */
@media (max-width: 768px) {
  .nav-container {
    flex-direction: column;
    padding: 0.5rem;
    gap: 0.5rem;
  }
  
  .logo-section img {
    height: 28px;
    max-width: 28px;
  }
  
  .site-title {
    font-size: 1rem;
  }
  
  .nav-tabs {
    gap: 0.3rem;
  }
  
  .nav-tabs a {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
  }
  
  .content-wrapper {
    padding: 0 1rem 1rem 1rem;
  }
  
  header.main-header img {
    max-width: 250px;
  }
  
  .map-container {
    top: 110px;
  }
  
  .overlay-box {
    top: 130px;
    right: 5px;
    width: 250px;
    height: 150px;
  }
  
  .content-section {
    padding: 1.5rem;
  }
  
  .page-title {
    font-size: 1.5rem;
  }
  
  .section-title {
    font-size: 1.25rem;
  }
  
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* Small Mobile (520px and below) */
@media (max-width: 520px) {
  .search-container {
    max-width: 100%;
    margin: 1rem 0;
  }
  
  .filter-wrapper {
    max-width: 100%;
    margin: 1rem 0;
  }
}

/* Very Small Mobile (480px and below) */
@media (max-width: 480px) {
  .site-title {
    display: none;
  }
  
  .map-container {
    top: 70px;
  }
}

/* ==========================================================================
   Touch Device Optimization - Always show links on touch devices
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  .card .donation-link,
  .card .more-info-link {
    visibility: visible !important;
    opacity: 1 !important;
    animation: none !important;
  }
}