@use "sass:color";

// Browse Jednostki Styles

// Modern Header Section
.modern-header {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 30px;
  margin-bottom: 30px;

  h2 {
    color: #2c3e50;
    margin-bottom: 5px;

    i {
      margin-right: 10px;
    }
  }

  p {
    color: #7f8c8d;
    margin: 0;
    font-size: 0.9rem;
  }

  // Search form section
  .text-center {
    margin-top: 25px;

    form {
      display: inline-block;
      max-width: 500px;
      width: 100%;
    }

    .input-group {
      background: #f8f9fa;
      border-radius: 6px;
      border: 1px solid #e9ecef;

      .input-group-label {
        background: transparent;
        border: none;
        color: #7f8c8d;
      }

      .input-group-field {
        background: transparent;
        border: none;
        font-size: 1rem;
        padding: 12px;
      }
    }
  }
}

// Letter Index Section
.letter-index {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-bottom: 30px;

  .letter-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
  }

  .letter-pill {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #e9ecef;

    &:hover:not(.active):not(.disabled) {
      background: #e9ecef;
      border-color: #dee2e6;
    }

    &.active {
      background: $primary-color;
      color: white;
      box-shadow: 0 2px 4px rgba($primary-color, 0.3);
    }

    &.disabled {
      color: #bdc3c7;
      background: #f8f9fa;
      border-color: #e9ecef;
      opacity: 0.5;
      cursor: not-allowed;
      pointer-events: none;
    }

    // Letter buttons specific styling
    &:not([href*="jednostki/"]) {
      // "Wszystkie" button - wider padding
      padding: 8px 16px;
    }

    &[href*="jednostki/"] {
      // Letter buttons - smaller padding, min width
      padding: 8px 12px;
      min-width: 40px;
      text-align: center;
    }
  }
}

// Jednostka Cards - Theme-specific overrides
// Base styles are defined in browse.scss
// This file should be imported AFTER browse.scss in app-*.scss files

.jednostka-card {
  .jednostka-name {
    margin-bottom: 8px;
    position: relative;
    padding-left: 35px; // Make room for the icon on the left

    // Icon positioned to the left of the name
    i.fi-home {
      position: absolute;
      top: 2px;
      left: 0;
      color: #bdc3c7;
      font-size: 1.5rem;
    }

    a {
      color: $primary-color;
      text-decoration: none;
      font-weight: 600;
      font-size: 1.1rem;
      line-height: 1.4;
      word-wrap: break-word;
      display: inline-block;

      &:hover {
        color: color.adjust($primary-color, $lightness: -10%);
      }
    }
  }

  .jednostka-details {
    color: #7f8c8d;
    font-size: 0.9rem;
    line-height: 1.3;
    padding-top: 8px;
    border-top: 1px solid #f8f9fa;

    > div {
      margin-bottom: 4px;

      i {
        margin-right: 5px;
        color: #bdc3c7;
      }

      &:last-child {
        font-size: 0.8rem;
        color: #95a5a6;
      }
    }
  }
}

// Warning Callout (No results)
.callout.warning {
  text-align: center;
  padding: 40px;
  border-radius: 8px;

  h4 {
    color: #856404;
    margin-bottom: 15px;

    i {
      margin-right: 10px;
    }
  }

  p {
    margin-bottom: 20px;
    color: #6c5c00;
  }

  .button {
    background: #ffc107;
    color: #212529;

    i {
      margin-right: 5px;
    }
  }
}

// Modern Pagination
.modern-pagination {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 20px;
  margin-top: 30px;
  text-align: center;

  .pagination-info {
    margin-bottom: 15px;
    color: #7f8c8d;
    font-size: 0.9rem;
  }

  ul.pagination {
    display: inline-flex;
    gap: 5px;
    margin: 0;

    li {
      // Ellipsis styling
      &:not(:has(a)):not(:has(span)) {
        padding: 8px 4px;
        color: #bdc3c7;
      }

      // Previous/Next buttons
      a[href*="previous_page_number"],
      a[href*="next_page_number"] {
        display: inline-flex;
        align-items: center;
        padding: 8px 12px;
        background: #f8f9fa;
        color: #2c3e50;
        border-radius: 6px;
        text-decoration: none;
        border: 1px solid #e9ecef;
        transition: all 0.2s ease;

        &:hover {
          background: #e9ecef;
        }

        i {
          &.fi-arrow-left {
            margin-right: 5px;
          }
          &.fi-arrow-right {
            margin-left: 5px;
          }
        }
      }

      // Current page number
      span {
        display: inline-block;
        padding: 8px 12px;
        background: $primary-color;
        color: white;
        border-radius: 6px;
        font-weight: 600;
      }

      // Page number buttons
      .page-btn {
        display: inline-block;
        padding: 8px 12px;
        background: #f8f9fa;
        color: #2c3e50;
        border-radius: 6px;
        text-decoration: none;
        border: 1px solid #e9ecef;
        transition: all 0.2s ease;
        min-width: 40px;
        text-align: center;

        &:hover {
          background: #e9ecef;
        }
      }
    }
  }
}
