// CLI Version 1.0.2
// Component Version 1.0.0

.dry-repeatableform {
  width: 100%;
  font-family: Arial, sans-serif;

  &__entry {
    width: 100%;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
  }

  &__fields-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
  }

  &__field {
    min-width: 0; // Ensures proper sizing within grid
  }

  // Styling for the Accordion component
  :global(.accordion__trigger) {
    background-color: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 15px 20px;
    font-weight: 500;
    color: #333;
  }

  // Styling for TextInput and Textarea components
  :global(.dry-textinput),
  :global(.dry-textarea) {
    label {
      font-weight: 500;
      margin-bottom: 5px;
      display: block;
      color: #555;
    }

    input,
    textarea {
      width: 100%;
      padding: 8px 12px;
      border: 1px solid #ced4da;
      border-radius: 4px;
      font-size: 14px;

      &:focus {
        outline: none;
        border-color: #a855f7;
        box-shadow: 0 0 0 2px rgba(168, 85, 247, 0.2);
      }
    }
  }

  // Styling for Button component
  :global(.dry-button) {
    margin-top: 10px;
  }
}

// ========================================
// Media Queries
// ========================================
// Adjusting desktop screens
@media (min-width: 1024px) {
  .dry-repeatableform {
    &__entry {
      padding: 20px;
    }

    &__fields-grid {
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
  }
}

// Adjusting for tablet screens (between small tablets and desktops)
@media (max-width: 1023px) {
  .dry-repeatableform {
    &__fields-grid {
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
  }
}

// Adjusting for smaller screens (small tablets and mobile)
@media (max-width: 768px) {
  .dry-repeatableform {
    &__entry {
      padding: 10px;
    }

    &__fields-grid {
      grid-template-columns: 1fr 1fr;
    }
  }
}

// Adjusting for smaller screens (mobile)
@media (max-width: 480px) {
  .dry-repeatableform {
    &__entry {
      margin-bottom: 15px;
    }

    &__fields-grid {
      grid-template-columns: 1fr;
    }

    &__field {
      margin-bottom: 10px;
    }
  }
}
