/* ------------ Main Layout Structure ------------ */
/* Main container uses flexbox to create sidebar + content layout */
main {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 2rem;
}

/* Container for stacked sidebar elements */
.sidebar-stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex: 1 1 220px;
  max-width: 250px;
}

/* ------------ Sidebar (Filters) Styling ------------ */
/* Main sidebar container */
aside {
  background-color: #fff;
  border-radius: 4px;
  padding: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  flex: 1 1 220px;
  max-width: 250px;
}

/* Filter section heading */
.filters h2 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

/* Individual filter group container */
.filter-group {
  margin-bottom: 1.5rem;
}

/* Filter labels styling */
.filter-group label {
  display: block;
  margin-bottom: 0.25rem;
  cursor: pointer;
}

/* ------------ Selected Countries Display ------------ */
/* Container for selected country chips */
.selected-countries {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

/* Individual country chip styling */
.country-chip {
  background-color: #e0f0ff;
  border: 1px solid #90caff;
  padding: 5px 10px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  font-size: 0.9em;
}

/* Remove button within country chips */
.country-chip .remove-btn {
  margin-left: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1em;
  line-height: 1;
}

/* ------------ Top Button Styling ------------ */
/* Container for top buttons */
.button-top {
  margin-top: 1rem;
  width: 100%;
  margin-bottom: 1rem;
}

/* Projects button styling */
.btn-projects {
  display: inline-block;
  background-color: #933f8d;
  color: #ffffff;
  padding: 1rem;
  border-radius: 4px;
  font-weight: bold;
  font-size: 1rem;
  width: 250px;
  transition: background-color 0.2s ease;
  text-align: center;
}

/* Projects button hover state */
.btn-projects:hover {
  background-color: #CCCCCC;
  color: #000000;
}

/* ------------ Froggy Help Component ------------ */
/* Main container for help section */
.froggy-help {
  background-color: #ffffff;
  border: 1px solid #d3d3d3;
  padding: 1rem;
  border-radius: 4px;
  text-align: left;
}

/* Help section title */
.froggy-text .title {
  font-weight: bold;
  font-size: 1.25rem;
  margin-bottom: 0.25rem;
}

/* Help section subtitle */
.froggy-text .subtitle {
  font-weight: normal;
  margin-bottom: 1rem;
}

/* Container for help action (image + button) */
.froggy-action {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Help section image */
.froggy-help img {
  width: 50px;
  margin-bottom: 0;
}

/* Help section button */
.froggy-help button {
  background-color: #3B609C;
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Help button hover state */
.froggy-help button:hover {
  background-color: #CCCCCC;
  color: #000000;
}

/* ------------ Search Functionality ------------ */
/* Main search container */
.search-container {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e0e0e0;
}

/* Search input field */
.search-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: #f9f9f9;
  transition: all 0.3s ease;
}

/* Search input focus state */
.search-input:focus {
  outline: none;
  border-color: #4a90e2;
  background: white;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* Search label */
.search-label {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #333;
}

/* Clear search button (hidden by default) */
.search-clear {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #999;
  padding: 0;
  width: 20px;
  height: 20px;
  display: none;
}

/* Wrapper for search input positioning */
.search-wrapper {
  position: relative;
}

/* Search results information text */
.search-results-info {
  margin-top: 8px;
  font-size: 12px;
  color: #666;
  font-style: italic;
}

/* ------------ Projects Section Layout ------------ */
/* Main projects content area */
.projects-section {
  flex: 1 1 650px;
  display: flex;
  flex-direction: column;
}

/* Projects section heading */
.projects-section h2 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
}

/* Grid container for project cards */
.projects-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

/* ------------ Individual Project Card Styling ------------ */
/* Main project card container */
.project-card {
  padding: 12px;
  box-sizing: border-box;
  border-radius: 8px;
  background-color: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.2s ease;
}

/* Project card hover effect */
.project-card:hover {
  transform: scale(1.02);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Project card images */
.project-card img {
  width: 100%;
  height: auto;
  border-radius: 6px;
  margin-bottom: 10px;
}

/* Project keyword/category text */
.project-keyword {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 4px;
  text-align: left;
  padding: 0 4px;
}

/* Project title */
.project-card h3 {
  font-weight: bold;
  font-size: 1rem;
  margin-top: 0;
  margin-bottom: 8px;
  text-align: left;
  padding: 0 4px;
}

/* ------------ Pagination Controls ------------ */
/* Pagination buttons */
.pagination-controls button {
  background-color: #3B609C;
  color: #ffffff;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  margin: 0 5px;
}

/* Pagination button hover state */
.pagination-controls button:hover {
  background-color: #CCCCCC;
  color: #000000;
}

/* Page number display text */
.pagination-controls span {
  font-weight: bold;
  margin: 0 10px;
}

/* Page size dropdown */
.pagination-controls select {
  padding: 0.3rem;
  border-radius: 4px;
  border: 1px solid #ccc;
  cursor: pointer;
}

/* Container for individual page numbers */
.page-numbers {
  display: inline-flex;
  margin: 0 10px;
}

/* Individual page number buttons */
.page-number {
  padding: 5px 10px;
  margin: 0 2px;
  cursor: pointer;
  border: 1px solid #ddd;
  border-radius: 4px;
}

/* Active page number styling */
.page-number.active {
  background-color: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

/* ------------ Submit Project Section ------------ */
/* Container for submit idea section */
.submit-idea-box {
  margin-top: 2rem;
  background-color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  padding: 1rem;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

/* Submit section heading */
.submit-idea-box h3 {
  margin-bottom: 0.1rem;
  text-align: left;
}

/* Submit idea button */
.submit-idea-btn {
  align-self: flex-end;
  background-color: #933f8d;
  color: #ffffff;
  padding: 1rem 1.4rem;
  font-size: 1.2rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

/* Submit button hover state */
.submit-idea-btn:hover {
  background-color: #CCCCCC;
  color: #000000;
}

/* ------------ Modal Dialog Styling ------------ */
/* Modal overlay (hidden by default) */
.modal {
  display: none;
  position: fixed;
  z-index: 1001;
  padding-top: 80px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.5);
}

/* Modal content container */
.modal-content {
  margin: auto;
  background: #fff;
  padding: 20px;
  width: 90%;
  max-width: 600px;
  border-radius: 10px;
  position: relative;
  animation: fadeIn 0.3s ease-in-out;
}

/* Modal heading */
.modal-content h2 {
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 20px;
  color: #2c3e50;
  text-align: center;
}

/* Modal form element spacing */
.modal-content form label,
.modal-content form fieldset,
.modal-content form details,
.modal-content form textarea,
.modal-content form input,
.modal-content form select {
  margin-bottom: 20px;
  display: block;
  width: 100%;
}

/* Form section headings */
.modal-content form h3 {
  margin-top: 30px;
  margin-bottom: 10px;
  font-size: 1.3em;
  border-bottom: 1px solid #ccc;
  padding-bottom: 5px;
  color: #34495e;
}

/* Collapsible sections styling */
.modal-content form details {
  background: #f9f9f9;
  border: 1px solid #ddd;
  padding: 10px 15px;
  border-radius: 6px;
  margin-bottom: 20px;
}

/* Checkbox grid layout */
.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 4px 15px;
}

/* Checkbox grid labels */
.checkbox-grid label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}

/* Checkbox spacing within grid */
.checkbox-grid input[type="checkbox"] {
  margin-right: 8px;
  margin-bottom: 0;
}

/* Collapsible section titles */
.modal-content form details summary {
  font-weight: bold;
  font-size: 1em;
  cursor: pointer;
  margin-bottom: 10px;
  color: #2c3e50;
}

/* Arrow indicators for collapsible sections */
.modal-content form details summary::after {
  content: "▼";
  float: right;
}
.modal-content form details[open] summary::after {
  content: "▲";
}

/* Form input styling */
.modal-content form input,
.modal-content form select,
.modal-content form textarea {
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

/* Invalid required field highlighting */
.modal-content form input:required:invalid,
.modal-content form select:required:invalid,
.modal-content form textarea:required:invalid {
  border-color: #e74c3c;
  background-color: #fff5f5;
}

/* Modal close button */
.close-button {
  color: #aaa;
  float: right;
  font-size: 24px;
  cursor: pointer;
}

/* Close button hover state */
.close-button:hover {
  color: #000;
}

/* Modal source link */
#modal-source {
  display: inline-block;
  margin-top: 10px;
  color: #0077cc;
}

/* Modal paragraph spacing */
.modal-content p {
  margin: 8px 0;
}

/* Modal strong text */
.modal-content strong {
  color: #333;
}

/* Dashboard button positioning for larger screens */
@media (min-width: 769px) {
  .dashboard-button-top {
    margin-left: 0.5rem;
  }
}

/* ------------ Responsive Design (Mobile) ------------ */
/* Mobile layout adjustments */
@media (max-width: 768px) {
  /* Center header content on mobile */
  header {
    text-align: center;
  }

  /* Stack header elements vertically */
  .header-content {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Stack main layout vertically on mobile */
  main {
    flex-direction: column;
  }

  /* Full width sidebar on mobile */
  aside {
    max-width: 100%;
  }

  /* Full width projects section on mobile */
  .projects-section {
    max-width: 100%;
  }

  /* Stack navigation links vertically */
  .nav-links {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  /* Full width dashboard button on mobile */
  .btn-dashboard {
    width: 100%;
  }
}