/**
 * CustomFilterList CSS - A reusable filterable table component
 * 
 * This CSS provides isolated styles for the custom-filter-list component
 * to avoid conflicts with other styles on the page.
 * 
 * Usage:
 * 1. Include this CSS file in your project
 * 2. Structure your HTML with the custom-filter-list class
 * 3. Include the JavaScript file: custom-filter-list.js
 * 
 * @author Generated for folker.world
 * @version 1.0.0
 */

.cfl {
  font-family: "Inter", Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5em;
}

.cfl h3 {
  margin: 0 0 15px 0;
  color: #2c3e50;
  font-size: 1.1em;
}

.cfl__filter-section {
  background: white;
  border-radius: 8px;
  margin-bottom: 20px;
}

.cfl__filter-section h5 {
  color: #2c3e50;
  font-size: 1em;
}

.cfl__filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.cfl__filter-tag {
  background: #f0f0f0;
  border: none;
  border-radius: 20px;
  padding: 8px 16px;
  font-size: 0.9em;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #2c3e50;
  font-family: inherit;
}

.cfl__filter-tag:hover {
  background: #bdc3c7;
  transform: translateY(-1px);
}

.cfl__filter-tag--active {
  background: #3498db;
  color: white;
}

.cfl__filter-tag--active:hover {
  background: #2980b9;
}

.cfl__results-count {
  font-size: 0.9em;
  color: #7f8c8d;
  font-style: italic;
}

.cfl__table-wrapper {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.cfl table {
  width: 100%;
  border-collapse: collapse;
  border: none !important;
  table-layout: fixed;
}

/* Default column widths for desktop only (can be overridden by shortcode) */
@media (min-width: 769px) {
  .cfl table thead th, .cfl table tr td {
    padding: 6px 0 6px 10px;
    text-align: left;
  }
  
  /* Default column widths for 4-column tables */
  .cfl th:nth-child(1) {
    width: 28%;
  }

  .cfl th:nth-child(2) {
    width: 27%;
  }

  .cfl th:nth-child(3) {
    width: 15%;
  }

  .cfl th:nth-child(4) {
    width: 30%;
  }

  /* Default equal widths for 5+ column tables */
  .cfl th:nth-child(5),
  .cfl th:nth-child(6),
  .cfl th:nth-child(7),
  .cfl th:nth-child(8) {
    width: auto;
  }

  /* Fallback: Equal distribution for tables with more than 4 columns */
  .cfl table:has(th:nth-child(5)) th {
    width: 20%;
  }

  .cfl table:has(th:nth-child(6)) th {
    width: 16.66%;
  }

  .cfl table:has(th:nth-child(7)) th {
    width: 14.28%;
  }

  .cfl table:has(th:nth-child(8)) th {
    width: 12.5%;
  }
}

.cfl thead {
  background: #f2f2f2;
  color: #111;
}

.cfl th:last-child,
.cfl td:last-child {
  padding-right: 10px;
}

.cfl table thead th {
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.85em;
  letter-spacing: 0.5px;
}

.cfl tbody tr {
  border-bottom: 1px solid #eee;
  transition: background-color 0.2s ease;
}

.cfl tbody tr:hover {
  background-color: #f8f9fa;
}

.cfl tbody tr:last-child {
  border-bottom: none;
}

/* Generic column styling - can be overridden for specific use cases */
.cfl__col1 {
  font-weight: 600;
  color: #2c3e50;
}

.cfl__col2 {
  color: #7f8c8d;
  font-size: 0.9em;
}

.cfl__col3 {
  color: #27ae60;
  font-weight: 500;
  font-size: 0.9em;
}

.cfl__col4 {
  word-break: break-all;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 0.9em;
}

.cfl__col4 a {
  color: #3498db;
  text-decoration: none;
}

.cfl__col4 a:hover {
  text-decoration: underline;
}

/* Legacy support for old class names */
.cfl__bold {
  font-weight: 600;
  color: #2c3e50;
}

.cfl__gray {
  color: #7f8c8d;
  font-size: 0.9em;
}

.cfl__green {
  color: #27ae60;
  font-weight: 500;
  font-size: 0.9em;
}

.cfl__link {
  word-break: break-all;
  overflow-wrap: break-word;
  hyphens: auto;
  font-size: 0.9em;
}

.cfl__link a {
  color: #3498db;
  text-decoration: none;
}

.cfl__link a:hover {
  text-decoration: underline;
}

/* Responsive Design - Mobile First */
@media (max-width: 768px) {
  .cfl__filter-section {
    margin: 10px 0 15px 0;
  }

  .cfl__filter-tags {
    gap: 6px;
  }

  .cfl__filter-tag {
    padding: 6px 12px;
    font-size: 0.8em;
  }

  .cfl__table-wrapper {
    box-shadow: none;
    background: transparent;
    overflow: visible;
  }

  .cfl table,
  .cfl thead,
  .cfl tbody,
  .cfl th,
  .cfl td,
  .cfl tr {
    display: block;
  }

  .cfl thead {
    display: none;
  }

  .cfl tbody tr {
    background: white;
    border: none;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 24px;
    padding: 10px 10px 5px 10px;
    position: relative;
  }

  .cfl tbody tr:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  }

  .cfl table tr td {
    border: none;
    padding: 0;
    text-align: left;
    position: relative;
  }

  .cfl td:not(.cfl__col1):before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: #34495e;
    text-transform: uppercase;
    font-size: 0.8em;
    letter-spacing: 0.5px;
    margin-right: 20px;
    display: inline-block;
    min-width: 120px;
  }

  .cfl__col1, .cfl__bold {
    font-size: 1.1em;
    margin-bottom: 5px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 8px;
  }

  .cfl__col1:before, .cfl__bold:before {
    display: none;
  }

  .cfl__col4, .cfl__link {
    padding-top: 10px;
    border-top: 1px solid #ecf0f1;
  }
}

@media (max-width: 480px) {
  .cfl tbody tr {
    padding: 12px;
  }

  .cfl table tr td:before {
    min-width: 80px;
    font-size: 0.75em;
  }
}
